If I try to use the variable this like below
Data this.data;
I get errors of
Error:(25, 9) java: not a statement
Type: Posts; User: jo15765
If I try to use the variable this like below
Data this.data;
I get errors of
Error:(25, 9) java: not a statement
I have my code as the below, where I declare the variable in my Data class, and from what I know, passing variable to the MouseEvent class. However, my JLabel prompt still shows empty?
public...
And I am assuming I will have to update how I call it? I am getting this compile error
Error:(45, 41) java: constructor MyMouseHandler in class MyMouseHandler cannot be applied to given types;...
I get a compile error of Duplicate Class: MyMouseHandler when I add this line in
//Add Constructor
class MyMouseHandler(Data data){
dt = data;
}
Why do you recommend against setting the variable as static?
I am new to JAVA - can you provide an example of this?
I have a class variable, that I want to set in a separate class. I am instantiating an instance of this class in my second class, and referencing and setting the variable. If I use a message box to...
After further testing, I am not sure why but adding in alignment for the label itself caused everything to display as I desired
lblCenterChar2.setHorizontalAlignment(JLabel.CENTER);
Can...
I thought that setting the max & min size of the labels with
setMaximumSize
setMinimumSize
would combat this. If I change the width of my sub-panel the image still remains directly...
Hi! I am going thro the flow layout tutorials and am attempting to set-up a panel with 3 labels that are left center and right in the panel. My code is so super close, I am sure it is something...
@Jim829 - I greatly appreciate this!! I like your approach of creating a method to createPanel - and your syntax properly aligns the label above the textbox. I had spent a great deal of time...
Updated OP to include imports and class information.
Hi - I am attempting to dump the GUI editor and code everything by hand :) - big task for me! I am setting up my JForm with 4 panels, 3 to hold my data and a 4th as a "parent" that will house...
Yes, I am using Netbeans GUI to write this code. - I just did a straight copy/paste of the class to ensure I did not omit any relevant code that could be causing my issue.
--- Update ---
So...
Hello - I have a main jframe that I am using to launch a secondary jframe - now my secondary jframe launches as I would expect and shows the header info, however the left panel (or the right panel...
I have been trying to use JTextField, but set editable to false and here is the line I run:
JLabel areaLabel = new JLabel("Answer Equals: ");
JTextField areaField = new JTextField(5);...
I have 2 JText fields where I put in a 1st number in textfield1 and a 2nd number in textfield 2. I then have a button for "Total" What I want to do is when the Total button is pressed, create a 3rd...
Cool :) I'll make a note of this, and use it in future coding projects!
How would I use that?
I was comparing the wrong 2 variables. Beginner's error. Thank you for the help! (As well as the future tip of printing the variables when results are not looking like I think they should)
When I print the value of the variables, they display properly (as they should). That's why I was curious if I wrote my If statement wrong.
Such a simple solution! I don't know why I didn't think of that! One more question...I think I have my if...else statement set up improperly. What it is supposed to do is if masterNumber equals...
I am running this code below:
public static void Check(int masterNumber)
{
int reverseIt = 0;
for (int i=0; i<=masterNumber; i++)
{
int r = masterNumber%10;
Ah, that makes sense. I was barking up the wrong tree thinking the error was due to trying to pull an int from a string array. Let me work on the coding a little bit and declare my statements a...
No it does not compile. When I try to compile that code, I get an error of:
error: cannot return a vlue from a method whose result type is void
To answer your questions:
--My plan of attack...