32,199 Topics

Member Avatar for
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
339
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
908
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
141
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
250
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
151
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
120
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
181
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
163
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
744
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
245
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
288
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
187
Member Avatar for ganges

Hi friends I am using eclipse and oracle 11g r2 i tried to configure oracle with eclipse "a driver already exists with that name please provide a unique driver name" This is the error I am getting kindly help me to fix this error thanks for your time.

Member Avatar for rubberman
0
143
Member Avatar for kyle.mace.35

Alright so I am making a rock paper scissors games and along with this game I am making a graph to show who has won more. My problem is how do I keep drawing the graph everytime someone wins?

Member Avatar for castajiz_2
0
80
Member Avatar for stanley.dominic

hi friends am nubie here and in world of programming i ve a i've learn few things about java programming and i wish to create a pos system using java but don't know were to start from, i need a head up my part of programming some advice and a …

Member Avatar for Helpmeplease123
0
218
Member Avatar for Benjamin_4

hello guys i am still new in java and i have been battling with this problem. i want to filter my data in my jtable. i have got the following data in my jtable which is from my database. | name | gender | courses | |------|--------|---------| | Ben | …

Member Avatar for mKorbel
0
1K
Member Avatar for manel1989

Hi everyone! In my code when I click on the "Show Results" button it shows me the result is a table in another interface other than the main interface, untel now everything is fine but when I changed the method : I just want to show this table in the …

Member Avatar for JamesCherrill
0
393
Member Avatar for Timlince55

I need to print out a pattern that looks like this when N=6 1 21 321 4321 54321 654321

Member Avatar for nabanit.sarkar
0
238

The End.