This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes scrollbar for  JTabbedPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "scrollbar for  JTabbedPane" Watch "scrollbar for  JTabbedPane" New topic
Author

scrollbar for JTabbedPane

vaka suresh
Greenhorn

Joined: Sep 23, 2002
Posts: 9
hi,
iam suresh. iam developing an simple java Swing application in which i have a main GUI which holds 6 tabs . is it possible to drag any of the tabs main GUI frame and view it seperately .
i tried setting a JScrollPane for the tabs but not visible .
could u pls help me out how to do this .
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Welcome to JavaRanch, Suresh.
There's a little rule around here about what your display name has to look like: 2 names, preferably your real name or one that looks real (the name rule).
Could you please take a minute to change your display name? Thanks, and hope you visit the ranch often.
Pauline
Bill Liteplo
Ranch Hand

Joined: Oct 16, 2002
Posts: 88
Are you saying that you want to drag a tab out of a tabbed pane and show the contents of that tab in a separate frame/window? Should the tab be removed from the original window? Should the contents of that tab be removed from the tab or should they be duplicated?
Or am I misunderstanding you?
Bill
vaka suresh
Greenhorn

Joined: Sep 23, 2002
Posts: 9
hi liteplo
thanks for ur kind reply for the question i have asked in javaranch.
what u have asked is right .
when i drag a new window or panel should come and the one in the main tab should dissappear.

i want to drag a tab out of a tabbed pane and show the contents of that tab in a separate frame/window. the tab should be removed from the original window. The contents of that tab be removed from the tab
could u pls tell me how to add a scroll bar for the tabs , i have added the jscrollpane but the scroll bar is not visible.
Bill Liteplo
Ranch Hand

Joined: Oct 16, 2002
Posts: 88
Try This post from, like, yesterday regarding making scrollbars appear.
API Javadocs are our friends
Regarding the DND issues... well, I'm not really an expert on that. I don't know how much, if at all, you have already attacked this problem. It helps if you are familiar with the Java drag and drop API (which I am not, really).
What I do know is that you should make the tab a drag source. That will let you pick it up. Then when you drag out of the window you can have your listener tell the tabbed pane to remove that tab. Since you don't really have a drop target other than thin air (i.e. the space on your screen not utilized by your Java program's windows), I'm not totally sure how to drop onto something, but I'm sure you can figure it out with some painstaking effort, sweat and significant profanity directed at Sun.
Sorry I can't give you much more than that.
Good luck!
Bill
vaka suresh
Greenhorn

Joined: Sep 23, 2002
Posts: 9
hi
thanks for ur sujestion.
how can i add a scroll bar for the JTabbs. i have 6 tabs in a frame . i have added the tabs for a scrollpane but still iam not getting the scrollbars. couldu pls help me out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: scrollbar for JTabbedPane
 
Similar Threads
pdf content is not showing in Firefox
Need help using J-Builder 3 !!!
SWT - rearrange the order of CTabItem
JTabbedPane Focus problem:
Design / Development Question