2,777 Posted Topics

Member Avatar for n3red

Actually isEmpty isn't enough, the String needs to be longer than what is being stripped off the front.

Member Avatar for n3red
0
121
Member Avatar for faithingod1970

Where in the code do you look for the problem area? Could you mark the location with a comment like: // *** HERE IS THE PROBLEM *** and then tell us how you have marked the code so we can look there.

Member Avatar for NormR1
0
309
Member Avatar for isengwa
Member Avatar for theinvincible
Member Avatar for peter_budo
0
302
Member Avatar for saurabh2007

If you don't know which of the two variables is null, add a print statement before the if statement to print out the values of each so you can see which is null. Also print out the values of a and b.

Member Avatar for NormR1
0
107
Member Avatar for SMITA6076

When using arrays of objects, there are two steps. One: create the array object. (Yes arrays are very like objects) Two: fill the array with the objects You probably have not done step two. textFieldArray[i][j] = new TextField(); // set i,j element to a TextField

Member Avatar for SMITA6076
0
463
Member Avatar for mipatel
Member Avatar for liphoso

[QUOTE]quit the slang as it makes it necessary to read your posts at least twice.[/QUOTE] Or maybe more times. Use full English. There are people in non-English speaking countries that use the forum and your gibberish will be doubly hard for them to understand.

Member Avatar for masijade
0
3K
Member Avatar for dante5458

Get an editor or IDE, design the program and type in the code, compile and execute it. Debug, make changes, compile and execute. Continue until you have what you want.

Member Avatar for omar mazen
0
256
Member Avatar for sam.udo

What code on the server does your java program talk to? What protocol is used?

Member Avatar for NormR1
0
67
Member Avatar for makmuhefe

Are you looking for help with this program? If so could you explain in more detail what your problem is. [QUOTE]But I cant create arrays and store datas from reading text file[/QUOTE] Can you explain this better?

Member Avatar for makmuhefe
0
240
Member Avatar for AnkitKumar
Member Avatar for kubiak

Also look at the Graphics class. It has methods for controlling display.

Member Avatar for kubiak
0
95
Member Avatar for CrazyPixel

One thing I see in your posted code is that you fall thru to set the textfield out of the catch phrase. Why not have the setText() call before the catch? Also the error message does NOT show what the invalid data is. Another suggestion is to do a printStackTrace …

Member Avatar for NormR1
0
161
Member Avatar for NPDA
Member Avatar for jackmaverick1

The problem with the code you posted is the () after JButton. Remove them and it should compile.

Member Avatar for jackmaverick1
0
223
Member Avatar for newbie14
Member Avatar for NormR1
0
182
Member Avatar for Princess90

But your wasting everyones time by posting these type of questions vs needing programming help. Write a code snippet that shows the problem and ask questions about how to make the code do what you want it to do.

Member Avatar for Ezzaral
-2
123
Member Avatar for gingerfish

[QUOTE] i want to test different set of elements in the array by looping.[/QUOTE] Do you know which set of elements you want to check? In the example you wanted to look at 0,1 and 9. Are there other sets of specific indexes to check? Are there always exactly 3 …

Member Avatar for NormR1
0
212
Member Avatar for M!ss Takishima

Also try debugging your code by adding print statements to show what is in the operation variable after it is read: System.out.println("operation=" + operation + "<");

Member Avatar for M!ss Takishima
0
176
Member Avatar for Princess90

You have left off what you have done so far. Do you have any specific questions about the program you have to write? You'll get better help if you show some effort in solving the problem.

Member Avatar for NormR1
0
144
Member Avatar for PRANOTI_N

A comment on your code: ALWAYS do something in a catch block to show you when there are errors. [QUOTE]object combo gets duplicated, if I again click [/QUOTE] Where do you clear the combo box before adding the new items?

Member Avatar for NormR1
0
120
Member Avatar for Tellalca

Go read some more about using the PopupMenu class. You need to use the show method. Perhaps a search on a java forum would find some code samples.

Member Avatar for Tellalca
0
94
Member Avatar for hfx642

[QUOTE] trying to reduce the number of *.class files [/QUOTE] Not sure how having static classes will [B]reduce[/B] the number of class files. There should be one for each class, even though there is a single .java source file.

Member Avatar for hfx642
0
475
Member Avatar for tracydo

Could you give an example of what your expected output would be for the input of: 34526? Think about how you would convert a String of "34526" to a decimal value in an int variable. Each digit character has a value 10 times the next one (for a decimal number). …

Member Avatar for NormR1
0
178
Member Avatar for tracydo

Why have you started a new thread instead of continuing the old one? Can you answer the questions I asked you about your program on the old thread?

Member Avatar for bibiki
0
478
Member Avatar for bangor_boy

Could you post a version of your code that will compile and execute and demo your problem?

Member Avatar for NormR1
0
285
Member Avatar for laitingfei
Member Avatar for lu25

Break the problem up into separate steps and do one step at a time. For example: prompt for a sentence and read in the sentence and print it out. See the Scanner class for a way to read in a sentence. Many code samples on this forum if you use …

Member Avatar for lu25
0
89
Member Avatar for Xessa
Member Avatar for MrDiaz
Member Avatar for SerialSpiller

[QUOTE]number3 = new Program4(number1.add(number2));[/QUOTE] What is the signature for the add() method? What args does it take and what does it return? Program4 is a weird name for a class. Shouldn't it be something like Fraction? You should post the program assignment directly and not require a pdf download.

Member Avatar for jane010794
0
1K
Member Avatar for cassyjack
Member Avatar for jon.kiparsky
0
2K
Member Avatar for extemer

Is the problem with the command you are trying to execute or with the OS reading the autorun file and properly trying to execute some command. For example what happens if you use open=Notepad.exe?

Member Avatar for ElieM
0
1K
Member Avatar for Kerrai

[QUOTE]error saying "Bound mismatch: The generic method sort(List<T>) of type Collections is not applicable for the arguments (ArrayList<Score>). The inferred type Score is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>"[/QUOTE] Which line in your code is causing this error?

Member Avatar for JamesCherrill
0
3K
Member Avatar for AaronLLF

[QUOTE]NoSuchMethodError: main [/QUOTE] Your class needs a main() method if you are going to start execution in that class by using the java command: java FPCameraController The java command looks for and calls the static method: main when it starts executing a class.

Member Avatar for kramerd
0
680
Member Avatar for kvass

Create Calendar objects, get the epoch times for each, subtract and divide.

Member Avatar for JamesCherrill
0
83
Member Avatar for jems5

[QUOTE]my output only produces the last set of values. [/QUOTE] How does the posted code relate to the problem with sorting and outputting only the last set of values? Where does the program save any values at all except for the last ones read? You need to save the all …

Member Avatar for jems5
0
164
Member Avatar for dalip_007

[QUOTE]The applet UI should simply permit selection of a file for upload from the local directory structure.[/QUOTE] Will the applet have permission to read files from the local system?

Member Avatar for dalip_007
0
154
Member Avatar for python_user
Member Avatar for red999

Have you tried using the equals() method with the two objects that are in the ArrayList to see what it returns? Does the Variable class have its own equals method or does it use the Object class's method? If you don't have your own method, you probably need one. Read …

Member Avatar for red999
0
2K
Member Avatar for samuel17

[QUOTE]if a middle name is not entered that it just ignores that it is not there[/QUOTE] Do you know how to use the if statement? Build your output String (displayed on lines 23-25) in steps using concatenation controlled by if statements.

Member Avatar for samuel17
0
140
Member Avatar for daudiam

Can you use the SwingUtilities method ONLY for the GUI interface calls and let your code run on its own, non EDT, thread? Can you make a small simple program that compiles and executes to demo the problem?

Member Avatar for daudiam
0
1K
Member Avatar for sw8revenge

Do you know how to define a class? You must if you have written any java programs. Can you explain specifically what problem you are having adding a class? What kind of class do you want? Inner or external? public or ?

Member Avatar for NormR1
0
146
Member Avatar for tyson.crouch

[QUOTE]i get thrown a Null Pointer Exception.[/QUOTE] What line is the error occurring on? What variable is null? What is the value of i when the error occurs?

Member Avatar for tyson.crouch
0
162
Member Avatar for toferdagofer

[QUOTE]it does not work correctly to check for the uppercase, lowercase, or the digit.[/QUOTE] Could you show an example where the code does not work properly. Comment out the JOptionPane and just assign a value to the input variable that shows the problem. Is the method supposed to show all …

Member Avatar for toferdagofer
0
134
Member Avatar for iceman709

[QUOTE] Every attempt I make fails[/QUOTE] Please copy and paste the error messages here.

Member Avatar for NormR1
0
1K
Member Avatar for asian_al

First you need to read the API doc to see what classes JApplet extends. Add an @Override statement before all the methods you are trying to extend to see if they are in a super class.

Member Avatar for NormR1
0
103
Member Avatar for shinnie

[QUOTE]the user only can input 5 times[/QUOTE] There are many ways to count what happens. The most common one is to use a loop.

Member Avatar for jon.kiparsky
0
293
Member Avatar for toshiro101

Sorry, we're here to help you learn how to program in java. If you have code that you are having problems with, please post it with your questions and we'll help you get your code to work.

Member Avatar for NormR1
0
161

The End.