Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2005

Tip: Looking for answers? Try searching our database.

unable to add scrollp pane to a panel in an applet

Thread view: 
chetan - 10 Feb 2005 06:41 GMT
I have an applet with a JTabbedPane .
One of the tabs has a JPanel on which I draw using the Graphics g
context.
Since the diagram turns out to be very large I tried adding a
JScrollPane to this JPanel using code

------------------------------------------------------------

JScrollPane myScroll = new JScrollPane( myPanel ) ;

------------------------------------------------------------

but the scroll bars do not show up.

I also tried

-----------------------------------------------------------

JScrollPane myScroll = new JScrollPane( mapArea ,            
                                     
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ,
                                   
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS) ;

--------------------------------------------------------------

but still no result

can anyone please help me.

Thanks in advance

chetan
Babu Kalakrishnan - 10 Feb 2005 07:35 GMT
> I have an applet with a JTabbedPane .
> One of the tabs has a JPanel on which I draw using the Graphics g
[quoted text clipped - 9 lines]
>
> but the scroll bars do not show up.

a) Make sure that your panel has a preferredSize parameter which
reflects its true size. (Call setPreferredSize)

b) Ensure that you add "myScroll" to the JTabbedPane and not "myPanel".
If you do the latter, it will be automatically removed from its existing
parent - namely the JScrollPane's viewport.

BK


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.