Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Closable Tabs

 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20608
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to Use Tabbed Panes. It has exactly such an example.
 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all the help. I relooked at the codes multiple times and did some changes and it worked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic