JPanel in Scrollpane
From: Gemmel (gunmuc_at_gmx.de)
Date: 10/28/04
- Next message: davout: "Midlet app size and web services - most efficient way of connecting?!?"
- Previous message: Bilal Sallakh: "Capturing an event when a Textfield changes."
- Next in thread: Babu Kalakrishnan: "Re: JPanel in Scrollpane"
- Reply: Babu Kalakrishnan: "Re: JPanel in Scrollpane"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Oct 2004 12:31:43 -0700
Hi!
i have a panel in a scrollpane. the panel has a preferred size of 300
x 300 pixel. the scrollpane fits in the main frame, and shows
scrollbars when needed.
i overwrote the paintComponent method, to draw some rectangles.
problem here: the cliparea is not 300 x 300 pixel, but the inside area
of the scrollpane. because of that im not able to draw exactly into
the panel.
I want to reach the following result:
the panel has a constant size of 300 x 300. the scrollpane is
flexible. the panel should always be in the center of the scrollpane,
whenever the scrollpane is larger than 300 x 300 pixel. the unused
space in the scrollpane should be darkgray.
if the scrollpane is resized to a smaller size than 300x300,
scrollbars should appear.
How can i get this effect?
Thanks
Gunter
- Next message: davout: "Midlet app size and web services - most efficient way of connecting?!?"
- Previous message: Bilal Sallakh: "Capturing an event when a Textfield changes."
- Next in thread: Babu Kalakrishnan: "Re: JPanel in Scrollpane"
- Reply: Babu Kalakrishnan: "Re: JPanel in Scrollpane"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|