2,777 Posted Topics

Member Avatar for effBlam

Can you describe the steps the code should take to solve the problem? What is the program supposed to do?

Member Avatar for NormR1
0
196
Member Avatar for hszforu

Try debugging the code by adding println statements that print out the values of all the variables as they are used. The print out will help you see what the problem is.

Member Avatar for hszforu
0
4K
Member Avatar for charmcity04

How do you want to display the file's content? One easy way would be to put the lines from the file into a JTextArea. I don't see any GUI code in your post. You have a lot to read about then: [Click Here](http://docs.oracle.com/javase/tutorial/uiswing/index.html)

Member Avatar for NormR1
0
290
Member Avatar for jonny93

> I now how to set the icons, but now I am absolutely confounded as to how I move the icon from one jbutton to the nu=ext as a way of movement. I want to be able to do this by use of a set of mouse clicks. Have you …

Member Avatar for NormR1
0
2K
Member Avatar for effBlam

To solve your problem you need to consider: How do the lines in the file relate to the rows in the array? How do the characters in a line relate to the columns in the array?

Member Avatar for NormR1
0
508
Member Avatar for Diogo Martinho

I don't think that the Java language has macros. Can you define what you mean by a macro? My definition is a source construct that generates different code base on parameters passed to the macro. What you are asking about sounds like recording of a script that can be played …

Member Avatar for JamesCherrill
0
164
Member Avatar for fo2sh

[QUOTE] to make it send the average to all clients[/QUOTE] Save the connections to all the clients so you can send more messages to them. One thing you could do would be to start a Thread to handle the connection when the accept returns a socket for that connection. Have …

Member Avatar for NormR1
0
909
Member Avatar for sweets

The more bits you change the more the original source will be changed allowing possible detection of the change.

Member Avatar for sweets
0
135
Member Avatar for chinee
Member Avatar for laura23

> how to get the persons name When you read in a line from the names file, you need to split the line into parts at the ;. The name looks like it is the first part of the line. Look at the String class's split method to do the …

Member Avatar for NormR1
0
215
Member Avatar for VeyRonX
Member Avatar for JamesCherrill
0
651
Member Avatar for Muhammad Anas

You should read the JFrame API doc about the method you are using. It is not one of the methods that has been overridden As a conveniance. Then Call repaint() to have the GUI redrawn.

Member Avatar for Muhammad Anas
0
6K
Member Avatar for J.S.AlKatheeeri

A class can have some methods with code that can be executed, an interface does not have any code.

Member Avatar for JamesCherrill
0
204
Member Avatar for chinee

> Exception in thread "main" java.lang.NullPointerException > at Main.GetAllAdjcentNodes(Main.java:69) Look at line 69 and find what variable has a null value. Then back track in the code to find out why that variable does not have a valid non-null value.

Member Avatar for emilo35
0
217
Member Avatar for polarbear125
Member Avatar for NormR1
0
368
Member Avatar for triumphost
Member Avatar for crownedzero

One way is to have accessor (get/set) methods in the class that owns the arraylist. If you are going to populate it in another method, have that method create it, populate it and return it.

Member Avatar for NormR1
0
271
Member Avatar for irtihussain

The variable: rand only exists when there is a instance of the Pickrand class. It is not defined as static. The code is trying to access it without first creating an instance of the class and of the variable. If it were static you would not need an instance of …

Member Avatar for irtihussain
0
1K
Member Avatar for macdunk11
Member Avatar for macdunk11
0
490
Member Avatar for nagatron

If you put the input to the method in an array, then you will be able to pass any any sized array you want to the method. If you pass the values separately then the number of parameters to the method is set when you define the method. If you …

Member Avatar for nagatron
0
251
Member Avatar for crownedzero

You are probably having a problem with the Scanner class. Scanner methods can be tricky. The Scanner buffers input and can block waiting for input. For example if you enter: A word to the wise <PRESS ENTER> and use next() only "A" is read, and "word to the wise" is …

Member Avatar for NormR1
0
207
Member Avatar for devninja

What timing of the printlns are you trying to achieve? Each thread is independent of the other. If you want them to coordinate when they print, you will have to change the code so that when one prints it starts the other one to do its wait. And so forth.

Member Avatar for NormR1
0
609
Member Avatar for joankim

"this" is a reference to the object that the code is executing in. In a method where the local variables passed as parameters have the same name as class variables, you use this to get access to the class variables. If the names are different,. you do not need to …

Member Avatar for devninja
0
282
Member Avatar for sonicx2218
Member Avatar for FUTURECompEng

The = operator sets the variable on the left of it to the value on the right.

Member Avatar for FUTURECompEng
0
271
Member Avatar for HungMob

> I keep getting an error Please post the full text of the error message.

Member Avatar for DavidKroukamp
0
190
Member Avatar for Afropuff01

Have you tried debugging by printing out the values that are used to see what the code is doing? For example print out what the nextDouble method returns and what the randValue is.

Member Avatar for NormR1
0
154
Member Avatar for jhamill

Add a println to show what is being compared so you can see what the computer is seeing.

Member Avatar for NormR1
0
313
Member Avatar for winecoding
Member Avatar for charmcity04

When the java command executes a class,it calls the class's main() method which is responsibe for starting the execution of the rest of the class. You main() metjhod is empty. You need to add some code to it that will call the methods to create the GUI and start things …

Member Avatar for NormR1
0
2K
Member Avatar for choosenalpha

If those are the only ones you want to print, then you don't need a loop. Using two println statements will work fine. The items to be printed don't look right. You should be using the name of your array, not Arrays.toString

Member Avatar for choosenalpha
0
209
Member Avatar for katiecathey

What specific java coding questions do you have? Can you post the code and ask your questions?

Member Avatar for JamesCherrill
0
710
Member Avatar for Majestics

It is not possible to change the size of an array. I recommend that you use an aray list if you don't know what the size is to be. Otherwise, define a new array with the desired size and copy the contents of the old array to it (see Arrays …

Member Avatar for NormR1
0
144
Member Avatar for raj.mscking

Cross posted at [Click Here](http://www.java-forums.org/new-java/58958-username-password-cliet.html#post282643)

Member Avatar for NormR1
0
265
Member Avatar for thechadv1

> I am getting caught up in private and public classes and methods... Please explain what your problems are and post the error messages you are getting. > am getting crazy numbers for a height. Please post the output from the program. Have you tried debugging the code? Add lots …

Member Avatar for NormR1
0
257
Member Avatar for Johannady2

Go through the code and find the matching } for every {. Some editors will do this when you position the cursor on a { and press a key combo: Ctrl+] on mine) the editor wll move the cursor to the pairing } Otherwise print the listing on paper and …

Member Avatar for NormR1
0
278
Member Avatar for huphane

What are the results when you execute the code? Post the full text of the error messages here.

Member Avatar for NormR1
0
283
Member Avatar for sdr001

> does not place a decimal in the geoPoint. Please explain and give an example.

Member Avatar for NormR1
0
126
Member Avatar for TakinANapster

Look in the browser's java console for any error messages. You should call the printStackTrace() method in the catch block to get better error messages.

Member Avatar for NormR1
0
1K
Member Avatar for jarograv

Please post the full text of the error message. Be sure to call the printStackTrace() method in the catch block to get the full text of the error message.

Member Avatar for jarograv
0
225
Member Avatar for Stjerne

> I tried getSelectedValues().toString(); but it didn't work What was returned? What was wong wiith it?

Member Avatar for NormR1
0
309
Member Avatar for sonicx2218

You will have to write a loop to get each element from the list one by one so you can print its value with its position in the list.

Member Avatar for NormR1
0
334
Member Avatar for brandon66

Write down on paper the indexes for the elements that you are to print. Then look at the difference between each of the indexes. Look at the definition of the for statement. What does the for statement's third expression/clause do?

Member Avatar for brandon66
0
617
Member Avatar for Mopikope

Please post the full text of the error message and a complete source a program that compiles, executes and shows the problem.

Member Avatar for Mopikope
0
155
Member Avatar for makehaste
Member Avatar for FUTURECompEng
Member Avatar for crazymidget01
Member Avatar for JamesCherrill
0
422
Member Avatar for sonicx2218

What is the range of the values of the numbers? For example: 10 to 9999999? How many numbers do you need? That will determine ways to get a list of unique random numbers.

Member Avatar for sonicx2218
0
2K
Member Avatar for timzter

You probably need the jar file that contains the classes in the package you are trying to import. When you get it, you'll have to put it on the classpath so the compiler can find it. Try Googling for the where you can download the jar file

Member Avatar for NormR1
0
159
Member Avatar for tjcrandall

Instead of overriding the frame's paint method, you should create a class that extends JPanel and override its paintComponent method

Member Avatar for NormR1
0
1K

The End.