Essentially, what I have is a very basic photoshop. A few of the features require some sort of pop up dialog that will display statistics for the image, or take input from the user to imply onto the image. Now, I have all the code written for actually working on the image itself (I've tested it and it works), but this is my first time working with JFrame and the like. That being said, I need a dialog to pop up when, for instance, the user clicks the Resize button and take input. That input then needs to be stored to a variable - from there, I have it.
If it helps, I attached my code as a .txt document. I didn't just post it here because of how long it is...
Thanks for any help!!!
If the code is too long to post in a forum, it's too long for me to be interested to go through. Recommended reading:
How To Ask Questions The Smart Way
SSCCE : Java Glossary
How to Make Dialogs (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
and the rest of the Swing tutorial.
The tutorial actually did help a lot. I've gotten this far now;
JFrame brightenDiag = new JFrame ();
JPanel JPANEL_BD = new JPanel();
JLabel JLABEL_BDL = new JLabel();
JButton okButton = new JButton("OK");
okButton.setBounds(0, 0, 75, 75);
JLABEL_BDL.add("Enter a positive integer between 0 and 255 to increase the brightness.");
But I keep getting an error saying that "JLABEL_BDL.add("Enter a positive integer between 0 and 255 to increase the brightness.");" isn't a variable, which I fully understand why. What I don't understand is how to create a static text field that says what I have in the quotes. I know the tutorial explained this, but I couldn't really follow.
As Darryl suggests, you should create a small compilable program that we can run, test and modify that shows your problem, an SSCCE. If you post this, you'll likely get a helpful answer quickly. I have to ask why you are calling add on a JLabel? Please look at the API and you'll see that this is not what add is for, that you'll likely rarely if ever need to call this on a JLabel, and if you do call it on a JComponent, you don't pass a String into this method, but rather a Component. Perhaps you wanted to call setText(...) instead? I also see that it attempts to mix console with gui in a bad way. Get rid of all code that requires users to enter information on the console. Also, you will want to read up on how to use layout managers.