35,618 Topics
![]() | |
Hi all, I need to deploy my application as https could any one help how can I do that | |
Hi, I wanted to know how I can add data to an ArrayList if the collection is not: `Private ArrayList<String> files;` and instead: `Private ArrayList<People> files`. Would the code look like this: public void addPerson(String name){ files.add(name); } or: public void addPerson(String name) { People people; // Declare an object … | |
Hello, I am making a authentication software, and this is the code for the Username panel. import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Scanner; import java.util.ArrayList; import java.io.*; public class Username { private static String username; private static char[] actualUsername; public Username () { final JFrame frame = new JFrame("Username"); … | |
Hello, I am making a Banking System, and this is the code for main. import static java.lang.System.out; public class BankSystem { public static void main (String[] args) { new username(); Password.setPassword("1234567"); new Password(); } } However, the problem is that both the username frame and password frame appears together. How … | |
I have a requirement where value of one field in an object will be determined dynamically using a configurable table. For example, suppose I have the following table - Pk | Reference_column ---------------------- 1 | TAB_REF.AMOUNT where TAB_REF is a reference table and AMOUNT is one of the column of … | |
Hi everyone, I was writing a program to show visually some vectors I was implementing with Java but I ran into an issue. My program has 3 classes, a driver, a Vector class and a VectorDisplay. The driver and vector class are self explanatory, but here is the code. Driver: … | |
Hello, I am writing a Java applet which uses the JExcel API to write to an Excel file. I have pasted the run-time error that I get below. After some research about the Exception, I added a policy entry using the policytool command for any Java program by selecting CodeBase<ALL>. … | |
Hello perhaps you could help me with a problem please. I wish to display a table of results using a JTable. Customarily I use a 2D Object array which is initialized with the data in a manner as follows: public Object[][] data={ {"Biology",25},{"Additional Math", 54},{"Geography",43},{"History",21},{"Spanish", 47}, {"Information Tech.",110},{"Technical Drawing",54},{"French",45},{"Physics",76},{"Chemistry",76}, {"Principles … | |
how do i check if a menu item in my JMenuBar has been clicked? for instance, i have a JMenu with an item called exit, which i need to make close the form. how do i do this? import javax.swing.*; public class selector_form extends JFrame { /** * */ private … | |
I am working on a java project for school. I am trying to think more into a professional mindset rather than a student. The project I am working on is about hashing. The rest of the project looks really good, but this part makes me wonder if a professional programmer … | |
how to print this pattern.....in java 1 23 456 7891 23456 | |
Hey there, I have the following code: int[] x = new int[7]; System.out.println(x.lengnth); x.length = 10; System.out.println(x.length); Of course, line three causes a "cannot assign a value to final variable length". However, line one does assign seven to that variable, length. Now, I have written a Testing class where I … | |
![]() | can u help me with this: public static void main(String[] args) { Scanner s = new Scanner(System.in); String name; System.out.print("What is your name? "); if(name.equals("Bob")) { System.out.println("Oh hi, Bob. I know you. Good to see you again."); name = s.nextLine(); } } } what can i do? |
first i'm not much professional in JAVA programming but if you mentioned a code how hard is it I'll understand it ... I want to create a desktop application that is connected with an online database to insert/retrieve data from it ... I've searched a lot on google but no … | |
This code can help you to find the square root of three numbers accepting the inputs from the user and displaying the results in a Joption pane. let me hope it will help import javax.swing.JOptionPane; import java.text.DecimalFormat; public class Squareroot { public static void main(String[] args) { String stringNum1,stringNum2,stringNum3; double … | |
**EDIT: I understood what was wrong. I initialized adrsarr[4] before trying to put in values, then the problem was solved. Please close this thread.** package personal; public class TestAddress { public void buildArray(Address[] adrsarr) { adrsarr[0] = new Address("B402", "3", "42", "Behind Sector 9", "New Delhi", "Delhi", "Delhi", "India", "232113"); … | |
Help..i need java program with help of bufferedReader and IOException... to find sum of 2 nos. entered by user.. plz help i am new to java... | |
A parking garage charges a S.R. 2.00 minimum fee to park for up to three hours. After that, garage charges an additional S.R. 0.50 per hour for each extra hour or less. The maximum charge for any given 24-hour period is S.R. 10. No car parks for longer than 24 … | |
Hi I am trying to implement an array based BT.Here is my code for this. But I'm stuck with Postorder traversal. How can I get a Postorder traversal from my array based BT ? My Entire code is given here. package com.TreeLab; public class Stack { private final int SIZE … | |
Write a program that prompts the user to enter a filename (use a Scanner to get the filename). The program then ouputs to the screen the number of lines, words, and characters in the file. Here is my code: (I'm getting a infinite while loop): import java.util.Scanner; import java.io.*; public … | |
Write a program that prompts the user to enter a filename (use a Scanner to get the filename). The program then ouputs to the screen the number of lines, words, and characters in the file. Im having trouble counting the words Here is my code: import java.util.Scanner; import java.io.*; public … | |
I am trying to add a try catch block with switches to my program in NetBeans, and it is not excepting any of my already declared variables?? Here is my original code, without any validation: package annual; import java.util.*; import java.lang.*; public class Annual { public static void main(String[] args) … | |
I created a hashing method to make a=1, b=2, c=3...etc. To me it doesn't seem too efficient. Does this look efficient or is there a recursive method or smaller method to do the same thing? /** * Changes String to int * @param key: String * @return (result % arraySize): … | |
Hi I recently started working with Java (this morning to be exact) and I'm running into some trouble. I'm trying to make a simple program that will put a deck of playing cards into an array, shuffle that array, then print the shuffled deck. My eventual goal is to make … | |
i have to do a program in BDK.my BDK and JDK are in the same folder java. i have set the path for jdk/bin in control panel.i have created the jar file, jar cfm [jar file name] [manifest file name] [java class name]. i didn't get any error there. but … | |
Hi all, this is my first post as a user, however ive been using this site to aid me in some of my programming assignments. I have become a little stuck with one program that i am trying to create which is a random number generator for 6 numbers. Ive … | |
I've been learning Java by myself through many different online and offline resources. I just finished some basic practice and theoretical knowledge of Swing. Now, to become good at it I need some practice problems which would test my Swing skills, including GUI Building, listeners etc. But I can't figure … | |
Last week I was working on some assignments using JDBC and now when I try to run programs in Eclipse this is what I get...and this is only part of the message that appears in the Console box instead of what should show when I run a program. What did … | |
Sorry everyone i'm new to java and i have an assingment which i have hand over soon i just want get an idea how to calculate car insurance premium based on the age,Licence and Engine size this is my first time come in to this site even so.. if you … |
The End.