New to Java, please help

D

Dino Buljubasic

Hi
I am quite new to java so this question is probably easy :)
Please help

I have a frame that holds north center and south panels
-norht panel has a JComboBox
-center panel holds a JScrollBar that holds a panel that is
dynamically loaded when a combo box item is selected.

my question is how do I make my frame redraw itself each time
a combo box has been clicked, or a new selection in combo box has been
made and as a result new center panel with dynamically loaded controls
has been created?

So far, when I click on my combo to open it but do not change
selected item then click again to close it, the region of frame that
was covered with its drop down list is not redrawn.

Also, the labels and text fields loaded seam to be not redrawn
properly. Say when I maximize my frame and then minimize it, some
labels dissapear. I am using GridBagLayout for this components to be
displayed

Any help will be appreciated
 
R

Rick

The redraw should be automatic. You haven't overridden the "draw"
method or some other superclass method have you?
 
D

Dino Buljubasic

No I have not ???

What I am doing is following

I place 3 panels on my form (NORTH, SOUTH AND CENTER

Then some controls inside NORTH AND SOUTH panels

then inside my center panel, on a button click, I create a panel that
expands JPanel. That panel is dynamically loaded with labels and text
fields holding data from database. When loaded, I add it to
JScrollBar and then add JScrollBar to the CENTER panel.
 
T

Thomas Weidenfeller

Dino said:
I place 3 panels on my form (NORTH, SOUTH AND CENTER

Then some controls inside NORTH AND SOUTH panels

then inside my center panel, on a button click, I create a panel that
expands JPanel. That panel is dynamically loaded with labels and text
fields holding data from database. When loaded, I add it to
JScrollBar and then add JScrollBar to the CENTER panel.

Show us code, written according to http://www.physci.org/codes/sscce.jsp

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top