0

Hello,

I have a JPanel (inside of a JFrame). I have a picture(.jpg), a JTextArea (with scroller) and a JTextField. On the JPanel, I want the picture left justified , the JTextArea right justified and the JTextField just below the JTextArea. What kind of layout would be appropriate?

Thank you!
sciprog1

Edited by sciprog1: n/a

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by sciprog1
0

Hello Ezzaral,

Thank you for the reply!

The program will be continually redrawing the picture depending on user input. If I use a JLabel to display the picture, can the redrawing be done?

Thank you!
sciprog1

Edited by sciprog1: n/a

0

You mentioned that it was a jpg. Will it be loading other jpg files based on input or actually altering the image in real time?

If you're loading from files, then JLabel is probably still an easy solution. If you're altering an in memory image and displaying it with Graphics.draw() then you could use any custom component (extend JPanel, JLabel, or JComponent) with an overridden paintComponent() method.

Edited by Ezzaral: n/a

0

Hello Ezzaral,

Thank you! I plan on overriding the paintComponent() method. If I have any issues with doing that, I hope you don't mind if I ask you specific questions about it?

Thank you!
sciprog1

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.