31,001 Topics

Member Avatar for
Member Avatar for server_crash

I have this problem with graphics, actually I know it's with my compiler... If I try to set the background of a button or something I get erros that's not even in my code.. I have this: [Code] btnCalc.setBackground(Color.blue); [/Code] and I get theses errors [Code] //g is already defined …

Member Avatar for server_crash
0
137
Member Avatar for OurNation

I have a GUI that displays a graph and I want to have some help with a code that allows you to click a point and then another point and then it draws a line. I need some help with this because I don't know were to start. ;)

Member Avatar for server_crash
0
100
Member Avatar for tigerxx

hey guys, I have problem in printing from java i have used PrinterJob in awt but it's going mad sometimes . it's going to it's print method two times some times doesn't print anything the code is ========================================================= [code] import java.awt.print.Printable; import java.awt.print.Book; import java.awt.Graphics; import java.awt.print.PageFormat; import java.awt.print.PrinterJob; import …

0
54
Member Avatar for ultimate_fusion

code is below int average(){ //method in class int total = 0; int NOS=5; System.out.println(""); for(int i=0;i<10;i++){ if(ID ==" "){ NOS = i; break; } total += mark;// total is the problem, tried printing it // while thefor loop was running and at the end // and its says "0" …

Member Avatar for server_crash
0
121
Member Avatar for MrScruff

Is there anyway of actually changing the length of a slider. I have a some sliders in a grid layout and im wondering wether the grid layout will stop the sliders from expanding.

Member Avatar for paradox814
0
234
Member Avatar for ultimate_fusion

I have two erros which I have tried everything to fix them C:\Documents and Settings\java:14: array required, but java.lang.String found ID[count] = ID; ^ C:\Documents and Settings\java:15: array required, but int found mark[count] = mark; heres the code class Module { String[] ID = new String[10]; int[] score = new …

Member Avatar for server_crash
0
109
Member Avatar for Jason Marceau

Hi, I am learning Java and I have decided that I should create my first project. I have the application code for a Tax calculator and I would like to add a GUI to it but I am struggling to work out how to enable the text field box to …

Member Avatar for ecyarter
0
3K
Member Avatar for the b

Hi all, does anyone know of a good compiler I can download for java? It would be nice if it was an IDE but it does not have to be. I currently have the j2sdk-1_4 compiler [url]http://java.sun.com/j2se/1.4.1/download.html[/url] and it does not seem to work that well. Also I know that …

Member Avatar for Jason Marceau
0
257
Member Avatar for server_crash

This class is suppose to create a JPanel with a bufferedimage to draw on..I instanstiate this class from the main driver class, and it shows up fine, but I can't draw anything on the image, or even set the background color of the jpanel. Here is the class, see if …

0
90
Member Avatar for cdt1983

Hi, I have set-up a while loop to iterate an amount specified by the user. However, is it possible to compare two numbers entered by a user inside the loop and then have the larger number replace the smaller? I am having trouble because I have the first result being …

Member Avatar for cdt1983
0
109
Member Avatar for mus_203

Hi I need help with devising a method that will calculate the frequency of elements in a chain data structure. Here's an example of what the method is supposed to do. If x = [3,6, 5, 9, 4, 5, 3, 5, 5, 1, 6, 10, 3, 3, 1, 7, 5, …

Member Avatar for tonakai
0
100
Member Avatar for George2

Hello everyone, I am wondering how to use java.util.Properties to get the corresponding value of a specific key whose corresponding value is an array, and I am also wondering how to express/format an array in a properties file. For example, I have a key "friends" whose corresponding value is a …

Member Avatar for George2
0
85
Member Avatar for server_crash

I plan on writing an app that will graph polynomial expressions. My question is, what should I draw the graph on? Should I just use the regular frame and use DrawLine(), or is there something like a bitmap, or canvas thing I should use?

Member Avatar for server_crash
0
94
Member Avatar for satimis

Hi folks, I shall start my first lesson to learn Java. I found following sites/tutorials; Tutorial (search) [url]http://onesearch.sun.com/search/onesearch/index.jsp?qt=java+tutorial&uid=6910019[/url] Java Tutorial [url]http://java.sun.com/docs/books/tutorial/[/url] [url]http://java.sun.com/docs/books/tutorial/information/download.html[/url] Java Tutorial Books [url]http://java.sun.com/docs/books/tutorial/book.html[/url] Java Tutorial Sites [url]http://java.sun.com/[/url] Java Tutorial, Trailmap [url]http://java.sun.com/docs/books/tutorial/trailmap.html[/url] Training [url]http://training.sun.com/[/url] Kindly advise which of them shall I stick to at start. Are there any …

Member Avatar for satimis
0
161
Member Avatar for ultimate_fusion

//main method int number = 1; int num = 3; details[] Darray = new details[number][num]; String name = JOptionPane.showInputDialog(null, "Enter the name", "Enter details", JOptionPane.QUESTION_MESSAGE); String DOB = JOptionPane.showInputDialog(null, "Enter the DOB", "Enter details", JOptionPane.QUESTION_MESSAGE); class details // i have default construtors aswell String getName(){ return name; } heres the …

Member Avatar for tonakai
0
83
Member Avatar for Lost Chyld

I need help with breaking out of a loop. I know it's something simple, but I can't remember. Here's my code. for(count = 0; count < inputArray.length; count++) { inputArray[count] = JOptionPane.showInputDialog( null, "Please input a name or exit: ", "Input Name", JOptionPane.QUESTION_MESSAGE); if(inputArray[count] == "Exit") { break; } }

Member Avatar for server_crash
0
96
Member Avatar for PaulaS

Hi, I have a project where we need to scan each pixel from an image. Somewhere in the image there will be a 10x10 red pixel and we need to draw a circle around it. This is the code I have so far: (but I'm having trouble figureing out the …

Member Avatar for server_crash
0
103
Member Avatar for BrownSuga

I am stuck trying to figure out syntax errors in program. Would appreciate help. Thank You In Advance :D These are the errors: C:\My Documents\myJavaFiles\Homework 2\Inventory.java:40: illegal character: \92 System.out.println("Item Already Exists --" ' +item + '); ^ C:\My Documents\myJavaFiles\Homework 2\Inventory.java:40: unclosed character literal System.out.println("Item Already Exists --" ' +item …

Member Avatar for BrownSuga
0
153
Member Avatar for freesoft_2000

Hi everyone, I have a small program in which i try to encrypt a zip or jar file but here is the thing in that eveything can be decrypted and encrypted without any problems but the archives(either a jar or zip file) after decryption later cannot be read. This does …

0
60
Member Avatar for freesoft_2000

Hi everyone, I am trying to add an undo listener to a jtable but could not get it to work. Does anyone know how to add a undo function to a jtable assuming the default cell editor component is a jtextfield? A small code sample would be helpful Any help …

Member Avatar for freesoft_2000
0
114
Member Avatar for pasaris

i want to make a simple applet in which a ball bounces using Runnable interface ..i know how to draw a ball , i know the translate() to change its location method but what i dont understand is how to use the Runnable interface's run() method fit into my applet …

Member Avatar for jwenting
0
63
Member Avatar for Gink

Im currently using method getKeyText() and getKeyCode() like this How do you listen for * - and + with keylisteners. / is the only one that works atm the rest won't get recognized for some reason if(event.getKeyText(event.getKeyCode())).equals("/")){ //do something } that method works, but when I try using a + …

Member Avatar for Gink
0
93
Member Avatar for George2

Hello everyone, I am looking for peer to peer programming resources (open source projects, tutorials or papers). I am wondering where can I find valuable ones especially Java based technologies. Thanks in advance, George

0
52
Member Avatar for jengels

When you have to write your own class, is it ok to call the scanner class in your class?

Member Avatar for server_crash
0
68
Member Avatar for freesoft_2000

Hi everyone, I have a question about the java multi-platform print dialog. I am able to show the dialog but here is the kicker in i am unable to select the printer properties on the print dialog. The printer properties button seems to be always disabled. This does not happen …

Member Avatar for freesoft_2000
0
128
Member Avatar for freesoft_2000

Hi everyone, I have two questions about the java multi-platform print dialog. The first question is about the printing of double-sided which is supported by some high end printers but the thing is that when i want to change the properties so that the user can decide if he wants …

0
46
Member Avatar for server_crash

I have a JMenu with some radio buttons...For some reason, when I click the stupid things, they won't do anything...and by that, I mean they want change their state to being clicked(as in the circle being filled)..It's like they are disabled...I'll post the snippets of code with them in it: …

Member Avatar for server_crash
0
123
Member Avatar for server_crash

Let's say I have two classes, Class1, and Class2..... Class2 creates and instance of Class1 and calls one of it's methods like this: [Code] Class 2 { Class1 c1 =new Class1(); c1.myMethod(); } [/Code] Now, that would work...But, could you have just the class variable instead of the class instance …

Member Avatar for server_crash
0
90
Member Avatar for George2

Hello everyone, Suppose I have a method which is a synchronized method (for example, method Foo in the following code block), and in this synchronized method another method which is not synchronized is invoked (for example, method Goo in the following code block). I am wondering when executing in Goo …

Member Avatar for George2
0
167
Member Avatar for freesoft_2000

Hi everyone, I have a question about key events. In the key events they have some values called as follows: static int KEY_LOCATION_LEFT static int KEY_LOCATION_NUMPAD static int KEY_LOCATION_RIGHT static int KEY_LOCATION_STANDARD I have seen the api and the explanation of what the above values represent and still do not …

Member Avatar for jwenting
0
67

The End.