31,001 Topics

Member Avatar for
Member Avatar for kenadams

Hello, I am just starting out with Java. But I had a big puzzle when I am in the first chapter. It says that we have to "initialize" the handle when we are creating one, like String s = "asdf", And later it says we have create a new object …

Member Avatar for kenadams
0
248
Member Avatar for mikewyatt

I have multiple jcomboboxes spread throughout my program. Most of these boxes get their data from names or text strings found in databases. Normally when adding a new item, it is added to the bottom of this list. What I want to do is when I add an element to …

Member Avatar for mikewyatt
0
1K
Member Avatar for ZixCo

HI. I'm new at programing in Java and I made a little program that: 1. Show current date 2. Show curent time 3. When button about pressed pop up about 4. When button setalarm pressed set Alarm(for begining in minutes) The problem is when i run the program everything works …

Member Avatar for ZixCo
0
488
Member Avatar for Stpdoug

I have another problem this time if anyone can help with random files i am writting and displaying records from the while but i want to display all records in the file that has data say i have 100 records but only 15 contain user data i want to display …

Member Avatar for Stpdoug
0
174
Member Avatar for sbhavan

I want to develop a web application. In that I need to implement that the user can't open it in more than one instance in any system. I want to restrict it based on the user and machine. ie. a single user name should be used to login to the …

Member Avatar for rubberman
0
470
Member Avatar for edrick.pascual.5

Write a program that displays the frequencies of sales commissions. The commission for each salesperson is calculated as $200 plus 9% of gross sales. For example a salesperson who grosses $5000 in a week makes 200 + .09 *5000 = 200 + 450 = $650 The program will input a …

Member Avatar for castajiz_2
0
487
Member Avatar for sankubha
Member Avatar for stultuske
0
104
Member Avatar for scottyg95

I need to create two public static void mains, however when trying to create "mainfunction", I run into the illegal start of expression. Please help. import java.io.*; import java.util.Scanner; public class guessinggame { public static void main (String []args) { Scanner scanner = new Scanner(System.in); System.out.println ("Guessing Game"); System.out.println ("Do …

Member Avatar for stultuske
0
338
Member Avatar for Stpdoug

Hey guys i am having a problem with displaying a single record out of a text file the code is not reaching the "if" function in the while loop of the "getRecord" Function please help. Everything else is working import java.io.*; import java.util.Scanner; import java.util.InputMismatchException; public class FileTest { //Globals …

Member Avatar for Stpdoug
0
325
Member Avatar for sravan953

Hey guys, As the title says, I want to know how I can reverse the characters in a string, but retaining the placement of the words as such, here's the code I used: [CODE]class reverse { void reverse(String s) { int l=s.length(),j=0; String s1=""; for(;j<l;j++) { char a=s.charAt(j); if(a==' ') …

Member Avatar for JamesCherrill
0
607
Member Avatar for Derek_4

I am trying to create a player class to pick up and drop as well as carry items and this is the code I have so far. However, I am unsure what needs to be changed for it to work. import java.util.ArrayList; public class Player { private String Name_; private …

Member Avatar for Derek_4
0
389
Member Avatar for newbie14

We have a socket application with lots of queries in it. The problem after doing some sample of jmap -histo we notice the number of sockets keep growing and resultsets fluctuates. Checked through and ensure all the resultset are closed and finally even the socket is close just based on …

Member Avatar for newbie14
0
893
Member Avatar for sankubha

i having thread class ,each time when i am calling it creates new object and run new thread, i want to access specified thread variable from another class. is it possible??? help me....

Member Avatar for JamesCherrill
0
140
Member Avatar for sk8ergirl

I have class with two method to read and write to file and in my GUI jFram ArrayList<PersonTest> person = new ArrayList<>(); RWData readWrite = new RWData(); DefaultListModel<PersonTest> model; private void fillList() { model = new DefaultListModel<>(); for (PersonTest temp : person) { model.addElement(temp); } jList1.setModel(model); } private void btnLoadActionPerformed(java.awt.event.ActionEvent …

Member Avatar for JamesCherrill
0
249
Member Avatar for Pyler

Multiple generic arrays is it possible to create something like <String, Integer>[] a; If I wanted to create an array that stores objects of String and Integer?

Member Avatar for jwenting
0
149
Member Avatar for vijaya436

I am a newbie to hibernate and I am trying to insert a row. The below is my code along with log. I am not getting any exception, however when verified in the Database, the row itself is not getting inserted. hibernate-cfg.xml <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration …

Member Avatar for vijaya436
0
3K
Member Avatar for aldahoudi

im trying to do this for fun but i cant figure out why i keep getting "null" instead of previous entry. ps. this isnt homework Thank you public class GetUser { public static void main(String[] args) { String name; String a []; char x='y'; int i; int n=1; do{ System.out.println(); …

Member Avatar for aldahoudi
0
116
Member Avatar for mikewyatt

I am trying to add /edit records in an embedded database. I have written some code that I think might work, but I would like a second set of eyes to look at to see if it is coded correctly..... private void Save_Item___MouseClicked(java.awt.event.MouseEvent evt) { if ("Equipment - Mundane".equals(jComboBox1.getSelectedItem().toString())) { …

Member Avatar for mikewyatt
0
209
Member Avatar for Delira

I'm trying to finish up this vending machine. It worked well until I tried to add multiple items via inheritance while using a toString method. I'm not sure what is wrong about how I've done this. import java.util.Scanner; public class VendingMachine { public static double moneyCredit; public static double itemCost; …

Member Avatar for Delira
0
3K
Member Avatar for castajiz_2

Is there any option which i can activate when using ECLIPSE so that when i m typing S... for String or i.. for int etc... to automaticly give me suggestions that i want a int if the first letter is i or i want a String if the first letter …

Member Avatar for JamesCherrill
0
180
Member Avatar for aelajj

I need to create a method compact that can remove all zeroes from an array and leave the order of other elements unchanged, but without creating a new array. The method must actually remove all zeroes, not just print out the other elements, and it should only use one private …

Member Avatar for JamesCherrill
0
1K
Member Avatar for murali2489

Hi Team, I have learned RMI Applcation basics.I have a Doubt in setting the Codebase and security policy file in the program during compile time itself rather than manually giving it during run time . During run time we will give like below in the command prompt, C:\>java -cp .;c:\hello.jar …

Member Avatar for ~s.o.s~
0
147
Member Avatar for jeromesturt
Member Avatar for Shaun_2
0
234
Member Avatar for jackbauer24

My computer does not have the swing.properties. How to make a swing.properties file and with what software?

Member Avatar for durim.kryeziu.927
0
1K
Member Avatar for stresstedout

Hi, I am new to java, so please be nice. I am trying to make an application in Netbeans, i know the basics of how to use the program but get a little stuck when it comes to programming. At the moment i am trying to get a button to …

Member Avatar for ObSys
0
162
Member Avatar for JohnSoftware

import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; import java.util.Scanner; import javax.swing.filechooser.*; import javax.swing.ScrollPaneConstants; public class validatiorGUI implements ActionListener { JFrame frame = new JFrame("C0015665"); JFileChooser chooser = new JFileChooser(); JPanel aPanel = new JPanel(); // create text area and buttons JTextArea area = new JTextArea(); JButton openButton = new …

Member Avatar for mKorbel
0
732
Member Avatar for hulkishungry

Hi, I studied Java last year in university but I found it rather difficult - mainly because I made it difficult for myself by not studying as much - but hey. I've been working on a console-based "game" with the language and I've just had a hit of inspiration to …

Member Avatar for mustafaneguib
0
243
Member Avatar for chdboy

Is there any way that I don't use lots of IF statements?,right now it is according to Index of combo box items. else if(e.getSource().equals(jcb1)) { int selectedindex = jcb1.getSelectedIndex(); String comb_string = (String)jcb1.getSelectedItem(); if(selectedindex==1) { try { //String sql_command ="select * , count(*) over (partition by 1) total_rows from Employer …

Member Avatar for JamesCherrill
0
286
Member Avatar for ZombieKnight93

This is what I have to do: Write an application that asks the user to input the radius of a circle as a floating-point number and draws the circle, as well as the values of the circle's diameter, circumference and area. Use the value 3.14159 for pi. [Note: You may …

Member Avatar for JamesCherrill
0
1K
Member Avatar for anestistsoukalis

this is the result i am trying to: http://beepleased.com/wordpress/wp-content/uploads/2013/11/2.jpg and this is my code: panelSignUp.add(new JLabel("Name:")); // this.getContentPane().add(nameTextField,) panelSignUp.add(nameTextField); panelSignUp.add(new JLabel("Email:")); // this.getContentPane().add(nameTextField,) panelSignUp.add(emailTextField); panelSignUp.add(new JLabel("Username:")); // this.getContentPane().add(nameTextField,) panelSignUp.add(userNameTextField); panelSignUp.add(new JLabel("Password:")); // this.getContentPane().add(nameTextField,) panelSignUp.add(passwordTextField); panelSignUp.add(signDone); this.setLayout(new GridLayout(5,2)); this.setContentPane(panelSignUp); this.setSize(400, 300); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.setVisible(true); all go well, the only problem is that …

Member Avatar for mKorbel
0
186

The End.