2,777 Posted Topics

Member Avatar for Krefie

On my computer this program prints 3 pages. I'm on WinXP SP3. [code] import javax.swing.*; public class PrintProblem { public static void main(String[] args) { JTextArea txtA = new JTextArea(); // fill up for(int i=0; i < 100; i++) txtA.append("this line forever " + i + "\n"); try { boolean …

Member Avatar for Krefie
0
169
Member Avatar for ubi_ct83
Member Avatar for ubi_ct83
0
103
Member Avatar for zaphytaffy
Member Avatar for zaphytaffy
0
280
Member Avatar for packer01fan

[QUOTE]++draw[ 1+ (randLotto.nextInt(35))];[/QUOTE] How large is the array "draw"? The max index into that array is the size - 1! What is the value of the index into that array: 1+ (randLotto.nextInt(35)) Is it less than the size of the array? What is that statement supposed to do? If you …

Member Avatar for packer01fan
0
722
Member Avatar for idblack

[QUOTE]what should i do to make a reverse[/QUOTE] You need to come up with the algorithm/design to do this. Take a piece of paper and work out the steps you need to do to reverse the list. Or use a deck of cards laying out a few cards in a …

Member Avatar for Taywin
0
167
Member Avatar for ttboy04

Put a newline character ("\n") at the end of the part of the string where you want the following string to go on the next line.

Member Avatar for Taywin
0
161
Member Avatar for fresidue

No idea if this will improve the speed. Here's some code that uses PixelGrabber to change colors: [CODE]// Fill a polygon starting at a clicked on point import java.awt.event.*; import java.awt.*; import javax.swing.*; import java.awt.image.*; import java.util.*; public class FillPolygon extends JPanel implements ActionListener { final int MaxLvl = 3000; …

Member Avatar for NormR1
0
277
Member Avatar for asad_80

Sounds like an indexing problem. Try debugging your code by printing out the values of the indexes that you are using as they are set and changed.

Member Avatar for NormR1
0
96
Member Avatar for anders10

Sounds like you could have two definitions using the same name. One local and one global. You update the local one. The global one never changes.

Member Avatar for NormR1
0
186
Member Avatar for gedas

[QUOTE]two .dll files (in the root of the project) if they are removed project does not compile [/QUOTE] I know of no .dll files that are outside of the javac command files that would cause problems with a compile. Can you explain what the .dll files have to do with …

Member Avatar for gedas
0
135
Member Avatar for NewOrder
Member Avatar for ardn0001

[QUOTE]How can I stop a job if time is more than 60 seconds?[/QUOTE] Use a Timer to call a method in 60 seconds.

Member Avatar for ardn0001
0
5K
Member Avatar for cela0811

For examples of GUI, do a Search for java files that extend the JFrame class.

Member Avatar for NormR1
0
64
Member Avatar for gedas
Member Avatar for gedas
0
167
Member Avatar for melicaster

Can you explain how your code works? Does it preserve its order as new nodes are added? Or can the user insert nodes anywhere and then call a sort method to sort the current list? [QUOTE]How to get it sort automatically everytime user entered a data?[/QUOTE] I don't see how …

Member Avatar for NormR1
0
391
Member Avatar for idontknow19

Can you show/post the input to and the output from your program? Have you studied arrays yet? What your code needs is an array to hold the values in as they are being read in. Once they are read in you can sort them and then print them.

Member Avatar for javaAddict
0
1K
Member Avatar for 1314abc

Hard to say without seeing the code. Be sure to use code tags (upper right icon) around your code.

Member Avatar for NormR1
0
106
Member Avatar for deiago

The IDE helps you write the app, but once the app is finished, the IDE goes away. I don't know how a particular IDE would change how you write your code. Of course I don't use an IDE so I can't tell you how to use it. If you have …

Member Avatar for Stefano Mtangoo
0
124
Member Avatar for ppotter3

Looks like the compiler is really lost. Possible cause is mismatched {} or (). Does your IDE have a Find matching function? Put cursor on a { and it finds matching } Or do it manually. Print out the source and use a pen to circle matching pairs.

Member Avatar for NormR1
0
725
Member Avatar for jt86442
Member Avatar for NormR1
0
628
Member Avatar for NewOrder

[QUOTE]how can i make the program look for corresponding words[/QUOTE] Looks like you need to build an array of substrings of what is in the first line and check if any of them are in the second line. The longer ones being better matches. For example Given: i will go …

Member Avatar for NormR1
0
212
Member Avatar for WargRider

[QUOTE]but the client just closes before the server [/QUOTE] have you tried debugging the code by adding println() statements to show where and what and why? What do you expect the code in the finally clause to do? And when?

Member Avatar for moutanna
0
156
Member Avatar for i2avi

[QUOTE]how to gradually draw a line [/QUOTE] Sounds like you need a Timer to call repaint() with small incremental changes in where the line is to be drawn. The persistence of the line would be effected by drawing over/or redrawing the old line each time together with the extension for …

Member Avatar for NormR1
0
108
Member Avatar for fraenckel
Member Avatar for fraenckel
0
111
Member Avatar for asad_80

[QUOTE]it does not work[/QUOTE] When you have errors, please copy and paste the full text of the message here. It saves lots of time figuring out what [B]does not work[/B]

Member Avatar for NormR1
0
146
Member Avatar for david cashin

Is your program an Applet or an application? An Applet requires a browser or Appletviewer to execute. An application needs the java command. In both cases you put the class files into a jar file for ease of handling. For the application to be executable without knowing which class to …

Member Avatar for NP-complete
0
2K
Member Avatar for 1x4n

[QUOTE]hat actually print like how i wanted?[/QUOTE] Can you explain "how I wanted"? The site at your link has code to generate Strings of XML and print them on the screen. Have you tried replacing the 'print to screen' method calls with classes and methods that will write the Strings …

Member Avatar for 1x4n
0
182
Member Avatar for kiranpvsr

Are you looking to write the code or for a package that does it? The Graphics and Graphics2D classes have methods for drawing. You override a paint/paintComponent method and use a drawing method to create anything you want.

Member Avatar for Taywin
0
73
Member Avatar for Dorayaki

What do you want the code to do differently? What does the API doc for text area say about the select() method? Are you assuming it is possible to select more than one area of text?

Member Avatar for Taywin
0
99
Member Avatar for xdeja

Do you have an algorithm or design for how you want you program to work? Once you get that, we can help you when you having problems writing the program.

Member Avatar for Taywin
0
4K
Member Avatar for Alex_

JLabels don't normally get the focus. You're going to have to tell the system that it can get the focus. There's is/are method(s) to call to enable this.

Member Avatar for Alex_
0
164
Member Avatar for trelek2

Have you read the API doc for the ConcurrentModificationException? Did any of that make sense? Are you using Swing components and threads in a way that could cause the error? There is a section in the Java Tutorial about how to update Swing components safely. Sorry, I don't have its …

Member Avatar for trelek2
0
199
Member Avatar for ttboy04

The friends variable only exists when there is an instance of the Test class created using new. The Names() method exists outside of any instance of the Test class. Either create an instance of the Test class and use object.variable syntax to access the variable Or remove static from Names() …

Member Avatar for ttboy04
0
149
Member Avatar for Victor C.

[QUOTE] need help to get it working [/QUOTE] What is the program supposed to do? What does it do that you want changed? My crystal ball is broken again.

Member Avatar for NormR1
0
195
Member Avatar for abbyo

[QUOTE]I should get 10.6842041GB (16.02630615GB total space needed). [/QUOTE] What do you get? You don't show what the program currently outputs. What is the program supposed to do? What is the relationship between: k, fps, min and seconds? I see that you are doing integer divisions. for example: gbyte = …

Member Avatar for abbyo
0
146
Member Avatar for mayanknsit

[QUOTE]i/o usage of a process?[/QUOTE] That sounds like Operating System stuff. It would probably require native code.

Member Avatar for NormR1
0
214
Member Avatar for RaniThomas

[QUOTE]i tried out bt not working[/QUOTE] Can you post what is NOT WORKING and show the errors or problems with it.

Member Avatar for NormR1
0
332
Member Avatar for learner15

[QUOTE]b1.addActionListener(this)[/QUOTE] This statement calls the addActionListener() method for the object b1. The reference to the action listener is saved in a list. Object b1 must be of class that can receive Action Events, like a key press. When that object b1 receives an Action Event, it looks in its list …

Member Avatar for NormR1
0
101
Member Avatar for Alex_

What happens if you use more primitive write/read methods that write bytes and read bytes and build an image from those bytes vs using ImageIO? You'd have to send a header with the length of the image data. Or write a small self contained program that demos the problem and …

Member Avatar for NormR1
0
1K
Member Avatar for djenoe

[QUOTE]Is there other way to write a Menu code, not using Switch, or creating other Method[/QUOTE] Can you define what "Menu code" is?

Member Avatar for adityats2020
0
108
Member Avatar for pula.alt

A lot of your arithmetic uses integers. integer division does not return real values. 1/3 = 0 or in English: 3 goes into 1 zero times. NO REMAINDER. No fractional part. Change the hardcoded integers to be real numbers. It would be better to define a CONSTANT to use in …

Member Avatar for pula.alt
0
140
Member Avatar for Victor C.

[QUOTE]When I enter a respond for either one and press the yes button,nothing happens.[/QUOTE] Add some System.out.println(what is happening here) statements to the code to show what is happening at that point.

Member Avatar for baris115
0
115
Member Avatar for NARAVA
Member Avatar for gedas
Member Avatar for RaniThomas

If you are able to compile the program, you must have the library with the classes needed. You need to make that library available at execution time so the java.exe program can find the missing class.

Member Avatar for RaniThomas
0
327
Member Avatar for dylgod

[QUOTE]cannot find symbol symbol : variable Total[/QUOTE] The error message says it all: The compile can NOT find a definition for the variable: Total.

Member Avatar for Victor C.
0
82
Member Avatar for nie2ks

Sounds like you need a mouse listener to detect the click and call a method to do what you want.

Member Avatar for NormR1
0
34
Member Avatar for sfrider0

[QUOTE]I need more of a global save[/QUOTE] That implies that you need a server to save the scores for all the users.

Member Avatar for NormR1
0
176
Member Avatar for jaysean

Sounds like an exercise for indexOf() - find the string in the source, and build a new source: "everything up to where found" + <tag> + foundString + </tag> + "everything after the end of the found string"

Member Avatar for jaysean
0
106
Member Avatar for CoffeeRookie

Do you have a design for the program yet? Think like a computer and write down the steps one by one that you must do to solve this problem. For resources: you'll need to use the Random class to generate numbers from 1 to 6. Use: System.out.println("the message you want …

Member Avatar for NormR1
0
88

The End.