| Author |
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 'xxx@jabber.org' and the other one is 'yyy@jabber.org'. When I run the codes, both titles are 'xxx@jabber.org' until when I select the second tab then would it turn to the expected 'yyy@jabber.org'.
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 'ChatPanel.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.
MainFrame.java
ChatPanel.java
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
How to Use Tabbed Panes. It has exactly such an example.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
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.
|
 |
 |
|
|
subject: Closable Tabs
|
|
|