Paul C. Anagnostopoulos
Nap, interrupted.
- Joined
- Aug 3, 2001
- Messages
- 19,141
If there are any Java Swing experts here, please PM me. There is so much magic in JScrollPanes that I'm confounded.
~~ Paul
~~ Paul
Oh man, I'd love to help you, but I haven't used swing in... months? years? Yes, more like years. But I'd suggest you post any questions here in addition to getting more direct help from experts. Maybe Gosling lurks here and he'd help if you only post the questionPaul C. Anagnostopoulos said:If there are any Java Swing experts here, please PM me. There is so much magic in JScrollPanes that I'm confounded.
~~ Paul
Not a swing expert, but I'll give to pieces of advice.Paul C. Anagnostopoulos said:If there are any Java Swing experts here, please PM me. There is so much magic in JScrollPanes that I'm confounded.
~~ Paul
Paul C. Anagnostopoulos said:Okay Pogo, let me ask some questions. I'm afraid I'm stuck with Swing for the time being.
I have a JFrame on which there is a JTabbedPane on which one of the tabs is a JScrollPane that scrolls a geneSeqPanel (extends JPanel).
The frame and the geneseq panel have a null layout manager.
As I expected, when I resize the frame, I have to resize the tabbed pane. However, resizing the tabbed pane appears to automatically resize the scroll pane and the geneseq panel. Should I have expected this? I cannot find any documentation that describes this behavior.
But that's not my big problem. I want to draw a diagram on the geneseq panel. It's width is the width of the scroll pane, but its height varies. I have no idea how the size of the geneseq panel interacts with its preferred size, nor even where I should set the sizes.
~~ Paul
Paul C. Anagnostopoulos said:I think what I really want to do is problematical. Whenever the paint method of the geneseq panel is called, I want to draw on a surface whose width is the current width of the scroll pane and whose height is variable, depending on the length of the gene sequence.
Paul C. Anagnostopoulos said:My fundamental problem is that I do not understand the relationship between setting the bounds of the gpanel and setting its preferred size.
pmurray said:So, at the end of the day, the container has the last word. To get the behaviour you want, you need (somehow) to get the container doing what you want.