This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

scrollbar for JTabbedPane

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Hot dog! An advertiser loves us THIS much:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic