Forums Register Login

Container (JPanel) refresh problem

+Pie Number of slices to send: Send
Hello,
In fact i have a panel (mainPanel) with a button OK, a another panel which display a specific MyJTable and combo box.
In fact, when I clic OK Button, i want to charge my MyJTable with data depends on comboBox.
First, i display a empty white panel and when i clic Ok i want to display my MyJTable.

I have a refresh problem, i try mainPanel.remove(emptyPanel) and thus mainPanel.add(myJTable), the remove works but the add no

Thanks for yu help!!
+Pie Number of slices to send: Send
instead of calling repaint(), you need to call revalidate()... repaint tells the component to repaint itself, revalidate tells the component it needs to run it's layout manager again and repaint... If you are adding or removing components, then the component needs to be layed out again.

-Nate
What does a metric clock look like? I bet it is nothing like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3605 times.
Similar Threads
2D Array Help
Not able to read the value of a component on one JPanel from a different JPanel
Swing Jpanel display problem
Problem refreshing a panel
Problem Updating a JButton
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:45:52.