File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Closable Tabs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Closable Tabs" Watch "Closable Tabs" New topic

Closable Tabs

Tay Thotheolh
Ranch Hand

Joined: Aug 07, 2008
Posts: 84
Hi. I tried to make a tab panel that have a 'X' to close the tabs but what I get is an huge 'X' in the middle of the tabs panels instead of being placed next to the tab titles. Fromm the codes, I have two tabs with two titles. One is '' and the other one is ''. When I run the codes, both titles are '' until when I select the second tab then would it turn to the expected ''.

The main problem I need help with is the close button for the tab.

You would notice I have a line of code in one of the java ''... around line 50+

What happens is that when I uncomment and attempts to add a textarea to the tab panels, the 'X' would completely disappear.

Why is that so ?

I need help for this closable tabs panel. Below are the 2 source codes.

Thanks for helping.

Rob Spoor

Joined: Oct 27, 2005
Posts: 20271

How to Use Tabbed Panes. It has exactly such an example.

How To Ask Questions How To Answer Questions
Tay Thotheolh
Ranch Hand

Joined: Aug 07, 2008
Posts: 84
Hi, Rob. As you may have noticed from my codes I posted, I did integrate those sample codes into my own codes and did some modification to suit my own application but somehow this modified codes did not work so well as I want it to.
Tay Thotheolh
Ranch Hand

Joined: Aug 07, 2008
Posts: 84
Thanks for all the help. I relooked at the codes multiple times and did some changes and it worked.
I agree. Here's the link:
subject: Closable Tabs
It's not a secret anymore!