(By the way, asking people to install IntelliJ IDEA and download a zip file will substantially reduce the number of people who might consider answering your question. If you have a small example code -- which would be an excellent idea -- it would be better to post it here where everybody can read it.)
Eugene Dakin wrote:What Java Listener should be used when populating a textField in a new form with data?
Well, this clearly isn't a question about IntelliJ so I'll move the thread to the Swing forum.
I don't see where you're actually creating a new JTextField.
I don't understand why you feel the need to use a listener to initialize that text field.
First of all you don't even create a text field, so you're just going to get NullPointerExceptions when you run that code. Your SecondForm class simply needs some code which creates a JTextField, adds it to the JFrame, and initializes its value. You'd put that before line 27. Unless there's some other requirement that I'm missing.
And, welcome to the Ranch!
Please follow Java naming conventions, variable names must begin with a lower case letter: SomeString, and TFTest.
I find it hard to believe that the XML you just posted actually generated the code you showed us earlier.
It looks to me like you're trying to learn Swing and IntelliJ at the same time, which I think would be harder than doing it one at a time. I would expect you to run into problems where you can't tell whether it's Swing or IntelliJ that you don't quite understand.
Paul Clapham wrote:If you're going to continue down that road, I would suggest starting with the simplest possible example. (I would suggest that anyway.) One form, one text field. See if you can get that working.
Carey Brown wrote:I would follow Paul's advice and avoid IDEs for the time being, they tend to have their own learning curve that gets in the way of learning Java in the beginning.
To answer your question though, In my 20+ years of Java consulting, every client used Eclipse.
Paul Clapham wrote:I'm using Eclipse too, but I don't use the plugin which allows me to design Swing forms graphically.
That's mostly because my Swing forms were basically all designed before I started using Eclipse; these days I rarely design new forms and it's not worth my time to learn the Eclipse plugin which would let me do that and figure out how to make it design forms which look consistent with the ones I already have. If I had a lot more forms to generate, I might spend the time, but that's not the case.
I've heard good things about IntelliJ, but I'm not switching from Eclipse because it's not worth my time to retrain myself on a new IDE. Installed System Bias, or something like that, is the name of that way of thinking.
Carey Brown wrote:I used the "Jigloo" plugin for a number of years. I really liked it but it never caught on and the company went belly up. It didn't impact my project though because the output was plain old Java code not xml or some such.
One wonderful thing I got out of the experience was an appreciation of GridBag which is "expert friendly" but incredibly powerful in terms of layout design. There's copies of a GBC utility (Java source code) floating around that makes the task manageable and the code more maintainable. Still, I wouldn't recommend GridBag as a place to start.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton