statement « GUI « Java Swing Q&A





1. Clarification --> Import statement    coderanch.com

2. Difference between java & javax in import statement    coderanch.com

"import" tells the Java compiler that it should look in a particular package for the Java classes named in a source file; i.e., if you write Vector v = new Vector(); Then you must include a line like import java.util.*; or import java.util.Vector; to tell the compiler which "Vector" you mean. That said, there's no difference at all between "import java..." ...

3. Name and Copyright statement    coderanch.com

4. If statement    coderanch.com

I have this code for a robot. To avoid an infinite loop, I would like for the escape key to close the program only I can't figure out how to use the escape key with the If statement.Here is my code. PLEASE HELP!!! import java.awt.*; import java.awt.event.*; import java.io.IOException; public class Robot05{ //Create an array of keycode data int keyInput[] = ...

5. Firing statements into Command prompt.    coderanch.com

Hi, Wanted to know if there was a way i could fire a statement into command prompt and display the results on a label((eg. c:\>ping 172.16.2.214) and display the results of the ping response on a label(which is refreshed every 50 milliseconds)).Displaying the results can be done by capturing the response in a .txt file and maybe using a threaded IO ...

6. if statement trouble within method    coderanch.com

Hi all, hope you can help here. I have no idea what the issue is. here is the code, please advise if you need more.... public void actionPerformed(ActionEvent aE) { //create buttonpressed object Object buttonPressed = aE.getSource(); //figure out which field was entered and //fill the other two fields accordingly if (celsiusField.getText() != null && buttonPressed == convert) { //grabs input ...

7. Switch Statement and GUI    coderanch.com

Hello everybody!! I was hoping to get a few pointers on the following code. I have class Sales and class Salesman. Class Salesman has attributes name and sales. I am mainly stuck because I am not sure how I should set up the switch statement in class Salesman. I want to calculate the total sales for each salesman and the grand ...

8. If statement not working for dropmenu calculations    coderanch.com

I am having trouble with my if statements being overlooked or something. In the code below for case 0, case 1 and case 2. I have a menu the user selects and it is to calculate depending on what the user selects. It calculates the same thing no matter which options is chosen. Could someone please let me know where I ...

9. update statement?    coderanch.com

hi, i have a question... i use Eclipse but i'm not very advanced in java... i wrote a sql statement in java by doing this : String qry = "select StudentId, StudentName, Majorid, Yeargraduated from STUDENT;"; and the above sql statement worked perfectly but i want to do the same with an update sql statement, so here is what i want ...





10. if statement problem    coderanch.com

I am new to Java Scripting and I am trying to write some code or if statement for the following. I have 2 JButtons (one labeled btnAddTwo and one lableled btnSubOne) and one text field.I am trying to get the btnAddTwo to add 2 when I click it and the btnSubOne to subtract one from the total in the text field. ...

11. Help with IF Statements and GUI    java-forums.org

I am having some trouble with making a GUI and IF statements. I need to be able to enter a number of votes for 3 particular "Art Piece's" and hit a calculate button and have the program put a checkmark next to the winner. Once the user presses the "calculate" button, the program will update the window to indicate which piece ...