Ofelia Stewart wrote:Hello! I am trying to figure out how to make a GUI for a Java Program I made, but I am having difficulty. How do I make elements connect to my written code? And what do I use to make a part in GUI that reads the output of the code I made? here is some of what I got if it helps. If you need more, let me know. I have never used/or done, GUI before...
Hmmm ... which suggests to me that you might be taking on too much too soon.
GUI programming, IMO, is a black art, practised by strange, visually-oriented gnomes, who love mucking about with scrolling text, and animations, and buttons and boxes of all shapes and sizes; and don't care that they have to write a thousand lines of boilerplate in order to get anything to work (I jest, but not totally ridiculously - it really does seem to be something that you either like or you don't).
My suggestion: Have a look at
the tutorials, and follow some of the examples and exercises, so that you get a good feel for how things hang together before you tackle something like this.
One thing I will say: You seem to have kept your GUI completely separate from your Inventory classes, which is a great place to start. Keep it up, and resist the urge to start mixing the two. There's no way that any 'J' class (JLabel, JComponent, etc.) should ever appear in something like a
Product.
HIH
Winston