31,001 Topics

Member Avatar for
Member Avatar for djdanjo82

Hello All, First thanks for taking time to read my thread. My problem is I have created a Gui Class that contains multiple JPanels inside another JPanel or ContentPane. I have just now created another Gui2 Class in the same java project and I would like this new Gui2 Class …

Member Avatar for djdanjo82
0
138
Member Avatar for mrgregkid

Hello im quite new to java and have been writing this game for my computer science class. ive been getting this illegal start of expression error on line 215 which is my 2nd public class dice extends applet and can not figure out how to fix it. ive tried moving …

Member Avatar for peace_of_mind
0
77
Member Avatar for k1lguy

hello, i have a java game but i have a problem with healing i get the error client.java:2791: orphaned case case 315: ^ 1 error files compiled successfully! this is the code: [ICODE]public boolean healing() { boolean eat = false; int heal = 0; case 315: Message("You eat the shrimps."); …

Member Avatar for JamesCherrill
0
228
Member Avatar for farooq82

I am trying to develop a java program containing two threads that reads two files simultaneously. In a program, first thread reads data from file “Personal_Record.txt” and second thread reads the data from file “Academic_Record.txt”. When one thread reads a line from one file then it should allow another thread …

Member Avatar for verruckt24
0
155
Member Avatar for kvprajapati

I am confused about static class and nested class. Is there any difference to code and use of static & nested class?.

Member Avatar for JamesCherrill
0
165
Member Avatar for PhoenixInsilico
Member Avatar for verruckt24
0
148
Member Avatar for localp

i am trying to get an input from my mic, and amplify the sound, i started searching for sample source codes, and java sound amplifying tutorials, but i found none of them relevant. so how can i amplify the sound that i received as input from a mic. can some …

Member Avatar for kvprajapati
0
45
Member Avatar for anandarju

Im developing a J2EE project and also Using JBOSS 4.0.2 server,when i run the Servlet program im getting the error "The Selection Is Not Within A Valid Module". Please Reply...Thanks In Advance....

Member Avatar for kvprajapati
0
63
Member Avatar for christiangirl

Hey, I am trying to find a way to limit how many characters a user can enter into a JTextField. Does anyone know how to do this? Thanks!

Member Avatar for kvprajapati
0
141
Member Avatar for christiangirl

Hello, I am having problems with indexOf() and contains() they work if I put letters in the code to test, but I want it to test what the user enters. And that is not working. The user enters a letter into a JTextField, and I am storing that word to …

Member Avatar for kvprajapati
0
167
Member Avatar for JamesKox

Hello guys, I'm trying to create a method where it takes a InputStream as a parameter, reads the stream and returns the number of characters it contains as an int. I'm having difficulties with this. I've searched the internet for examples, but i can't find one that helps me with …

Member Avatar for kvprajapati
0
2K
Member Avatar for chengkochung

Hi There, We have one java class which is to do the document generating, and from the log files we found that this servlet doing the replacing the data "PK" to "Key", wondering why it doing this. 2009-05-22 12:07:24,921 [ (self-tuning)'] DEBUG rk.servlet.PDFGeneratorServlet - Replacing the PK's with Key values …

Member Avatar for kvprajapati
0
117
Member Avatar for kashn

Hi, I'm trying to figure out how can I make split read from the file and recognize how to put the strings into an array from a file, based on a new line break. Example of my txt file: [ICODE]This will be my first huge paragraph, it will contain many …

Member Avatar for javaAddict
0
216
Member Avatar for flash121

I want to read a jpg image from a file to an Image object and then paint it on my JPanel, but the image doesn't appear.I've tried drawing some other stuff on the panel (like lines etc.) and everything appeared without any problems. My code: This class represents my JPanel: …

Member Avatar for flash121
0
166
Member Avatar for Isy

I am creating a mobile game using Netbeans IDE 6.0.1 but I have a problem adding new configuration I get the following error: java.lang.NullPointerException at org.netbeans.modules.mobility.project.ui.customizer.NewConfigurationPanel.isValid(NewConfigurationPanel.java:198) at java.awt.Component.invalidateIfValid(Component.java:2740) at java.awt.Component.setLocale(Component.java:1810) at javax.swing.JComponent.<init>(JComponent.java:595) at javax.swing.JPanel.<init>(JPanel.java:65) at javax.swing.JPanel.<init>(JPanel.java:92) at javax.swing.JPanel.<init>(JPanel.java:100) at org.netbeans.modules.mobility.project.ui.customizer.NewConfigurationPanel.<init>(NewConfigurationPanel.java:96) at org.netbeans.modules.mobility.project.ui.customizer.J2MECustomizer.run(J2MECustomizer.java:304) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) anyone know what …

Member Avatar for peter_budo
0
248
Member Avatar for custurd12

[code] import java.io.*; import java.util.*; public class lab11_2{ Scanner in=new Scanner(System.in); private int month=12; private int sum; private int value; private int rainfall; private double total=0; private double average; private double standard_deviation; private double largest; private double smallest; private double months[]; public lab11_2(){ months=new double[12]; } public void setMonths(){ for(int …

Member Avatar for JamesCherrill
0
2K
Member Avatar for gigantic

hi, i want to draw rectangle based on mousedrag event. if user dragging the mouse, then the rectangle on the applet should increase or decrease basing on current mouse coordinates. i have the following code. in the following code i am using [b]SelectionArea[/b] class which extends a canvas on which …

Member Avatar for zyaday
0
657
Member Avatar for soultrav

How do i compare an object with null? From what i've seen right now, at execution an NullPointerException will be thrown :S For example, if I have a list: [code=java] class List { private Node data; private Lista urm; public List(Node d,Lista u) { data = d; urm = u; …

Member Avatar for Zibo
0
7K
Member Avatar for Frostra

Below I described a complex polynomial which is a part of my newton method. When I define the complex number [x = new ComplexNumber (0,0)] it only returns 0 or 1. Also I have overriden the basic string format to make it look like a complex number, but it doesn't …

Member Avatar for javaAddict
0
164
Member Avatar for mohiit
Member Avatar for Poppystar

I am new to programming and am trying to create a program to access a database of DVD's. I want to input a unique code for a title and display relevant fields from that record. I am getting the error above and have spent many hours now trying to see …

Member Avatar for Poppystar
0
574
Member Avatar for lifeismusic434

Hello everyone, I am trying to update a JTable after a user clicks a button. I have a bunch of data in a TreeMap, which I then convert to a String[][], and pass to a DefaultTableModel, and then use that DefaultTableModel in the JTable. When the user clicks a button, …

Member Avatar for lifeismusic434
0
99
Member Avatar for JustmeVSI

Hi. My problem i guess it is simple but i guess I'm simple as well :). The problem is the flowing: I have a JTextFead and a search method for IDs. The IDs are 7 char long. I want to be able when the user enters 7 chars the search …

Member Avatar for JustmeVSI
0
103
Member Avatar for KirkPatrick

Just had a quick question about my code. Seems like a very simple solution, perhaps I'm just too sleepy to think straight. What I am wanting to do is if a certain index is selected in my combobox i want certain textfields to display which is apparent by the code: …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Dendei

Hi me and my class are getting this problem with tim.start(); and stop. we get start to work with a button but cant stop and we can stop with the keyboard but not with the buttons bad explaination i know but have an look plz :P [CODE] /* * To …

Member Avatar for Dendei
0
121
Member Avatar for grisha83

Hello, For some reason, my program prints out extra zero from my linked list Can anyone tell me why? Thank you [ICODE]public class Main { public static void main(String[] args) { IntNode my = new IntNode(5,null); LinkedList list = new LinkedList(); list.createList(0); list.addValue(1); list.addValue(23); list.addValue(3); list.addValue(4); list.print(); list.getLength(); } }[/ICODE] …

Member Avatar for grisha83
0
89
Member Avatar for grisha83

Hello, I was wondering why do we need to assign value of -1 to the top of the stack? topOfStack = -1; Thank you

Member Avatar for grisha83
0
96
Member Avatar for username7260

Ok, i got this so far ... [code] import java.util.regex.Matcher; import java.util.regex.Pattern; public class Testing2 { public static void main(String[] args) { Pattern p = Pattern.compile("[wati]"); String text = "water"; Matcher m = p.matcher(text); if (m.find()) { System.out.print("Found !"); } } } [/code] With that code i got a match, …

Member Avatar for masijade
0
131
Member Avatar for DeathWalker101

Hey all, Im working with assembly atm and thought i might just get a better idea understanding loops if i know how java loops work not that it is really the same im just trying to back track. Im trying todo the following: When var1 = 3 It then needs …

Member Avatar for mvmalderen
0
80
Member Avatar for airey1988

Hi i have created a list which reads from a text file. how can i view the contennts of the list outside of the method it was created. I have inserted my code below. [ICODE]//read Customers.txt and save in an object. List<Customer2> list = new ArrayList<Customer2>(); File file = new …

Member Avatar for giri.pankaj
0
79

The End.