Forums Register Login

Total Newbie question (adding items to TabbedPanes)

+Pie Number of slices to send: Send
Hi all

I'm pretty new to Java and Swing and I'm having quite a problem wrapping my head around the layout concept. Specifically (at the moment) I'm trying to create a JTabbedPane and add objects to one of the Tabs. It works fine when I just add one object (like a JTextField or even a JTable), but I'm stuck at adding more than one object. If I understand correctly, you cannot add more than one object directly to the tab, so I have tried to create a JPanel and adding items to it, but it's not really working. Any hint on how to do this would be much appreciated.

Thanks,

Anwar
+Pie Number of slices to send: Send
 

Anwar Dalati wrote:If I understand correctly, you cannot add more than one object directly to the tab, so I have tried to create a JPanel and adding items to it, but it's not really working.



That is the correct thing to do. How is it not working for you?
+Pie Number of slices to send: Send
> Any hint on how to do this would be much appreciated.

if you search for the phrase (include quote marks)
"new JTabbedPane"
you should find plenty of sample code to study.
+Pie Number of slices to send: Send
Hi!

Brian Cole wrote:That is the correct thing to do. How is it not working for you?



Dunno - I think I just needed some confirmation.

When I sat down today and gave the code a bit of tidying up, it suddenly worked. Thanks!

- Anwar
keep an eye out for scorpions and black widows. But the tiny ads are safe.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 697 times.
Similar Threads
Creating one class from another
JMenuItem question
What's faster awt or swing ?
Basic swing application; class extending JPanel won't update graphics
Best Practise?
More...

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