Oh, I see! I didn't even think of that! So instead of having one comboBox/Label for each array, have one for each position and modify the contents as needed.
Type: Posts; User: Blasfemmy
Oh, I see! I didn't even think of that! So instead of having one comboBox/Label for each array, have one for each position and modify the contents as needed.
What errors are thrown? Also, can you format your code so that it is easier to read(i.e. tab things over, comment things out, etc.)?
--- Update ---
And use the code tags when posting chunks of...
This is where my problem was originating from though. I don't want it to add them to them bottom, but to overwrite them, to have them put in the same spot where the previous one was. For example,...
Your error lies here: It should be
if(number != -99) { Keep in mind that the user needs to be continuously prompted (loop) with the questions for entering a number. What this does is ask the...
The main differences between the three loops that you described are:
A "do-while loop" checks to see if the condition is true or false after the code is executed.
A "while loop" checks the...
If you break the problem down into small steps, then the problem will not seem nearly as complex.
This is going to be your loop.
In psuedocode:
do {
//prompts user to enter a...
Can you post your code so that we can look over what you have already done?
Can you elaborate upon this? What error messages are you getting?...
I'm trying to add them to an array index, but I can't seem to figure it out. I am getting an incompatible data types error, thus I presume that I am declaring them incorrectly.
I added the...
Ahh, I see, it is working nicely!
Here is that updated snippet:
super("Athletic Trainer Sign In");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout (new GridLayout(8,2)); ...
What do you have done thus far? Can you be more specific? No one on here is going to write your program for you, the forum section is called "What's Wrong With My Code," not "Write My Program."
Okay, so I cleaned up the code a bit, and was able to make the JComboBox disappear when not selected.
I figured that it couldn't hurt if I added it to prevent a compiler error, because at that...
Yeah, I was planning on cleaning up the code a bit and worrying about the layout later, once I got these few program-breaking errors fixed.
Hmm, would I be able to assign something like
...
I my thinking was that the initialization of the JComboBoxes are based off of the value of the selectedValue, thus while it is selected, then it is initialized, and when it is not selected, it...
Okay, when the program runs, there is a JComboBox that contains the bodyPart array. What it is supposed to do is when one of the items in the JComboBox are selected, it makes another JComboBox...
Greetings! I am having some trouble with JLabel.
This is a Sign In program for my high school's athletic trainer that I am writing. When it first runs, it should display an empty text field...
I'm very new to arrays, which is why I made a mistake like this, thanks for the help!
After fixing that, these are the errors that are left:
I don't understand these errors. I thought that...
I need some assistance with debugging my code.
Here are my objectives for this program:
-Randomly input 20 numbers from 1 to 10 into a 2D array of 5 rows and 4 columns
-Output: the 2D array and...
Sorry about not using the code=java. I think now that I have a better grip on the syntax for java, progressing forward will be a lot easier. For some reason this concept just wasn't clicking. ...
With this update, I was able to use If-Else statements to check to make sure that the user does not input more hours than there are in a week (168). At the moment, it exits the program. How would I...
Great idea!
Is this what you were referring to? With this I am able to simply delete the variable listed under "setAllVariables" and it won't be included in the execution of the program.
...
I think I finally understand this concept! Here is what I have:
import java.util.Scanner;
public class Modification_of_3_4 {
public static void main(String[] args) {
Okay, the first time running it, it outputs "Hello World" as expected. The second time it outputs "null null", is this because the "String" is conflicting with the "void" in the header, thus making...
I tried again to get it to return a value, this time looking a lot closer at the example and still can't get a return value:
import java.util.Scanner; //Takes user input
import java.text.*;...
Okay, that made a lot of sense! How can I set it so it actually returns a value? Would I have to declare a new variable and set what value is returned equal to that variable?
Here is my attempt:...
I'm still confused on how this works >< I can't take a break from code writing, this is a project due tomorrow, and I've been trying to figure this out for almost a week now. Looking at the posted...