Adding Scrollbars to a canvas



Hi newsgroup,

I hope this is one of my last questions, but nevertheless I'm still in
trouble with my project:

I created a canvas whre some objects are drawn. Now it could be possible
that the width of this canvas is too large for the screen width so I would
need horizontal scrollbars to be able to scroll to the end of the canvas. My
canvas class extends the JPanel object so maybe I have to use JScrollPane(?)

Now I tried to use ScrollBar directly, as well as reading the API about the
JScrollPane but I'm still confused about how to use...

Once again, thanks very much in advance for any help.

With best regards

Frank


.



Relevant Pages

  • [Tk] hard resizing
    ... And scrollbars: .ar.sx, .ar.sy ... a window .ar.c.f is created on canvas. ... The .ar frame seems to start with predefined height. ...
    (comp.lang.tcl)
  • scrollbars again
    ... However this canvas has fixed width, which makes me state from the beginning, ... window (scrollbars can remain). ... For each line there is a horizontal bar with some buttons and labels. ...
    (comp.lang.tcl)
  • Re: Scrollbars get obscurred when painting image; how to fix
    ... of the application window so that the scrollbars appear, the image is painted over the scrollbars and obscures them. ... A button of the same size as the Canvas doing the painting does not show the same behavior. ...
    (comp.lang.java.programmer)
  • wpf: scroll canvas to objects beyon top or left side.
    ... I have a wpf project where I use a canvas to drag shapes around. ... drag a shape beyond the right or bottom side I get scrollbars which is good. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: binding to a derived canvas widget
    ... main script, the internal class bindings stop working, i.e. ... Why do you construct an additional canvas in Line 63? ... Do I manually need to build the scrollbars? ... That explains why my widget seems dead from main. ...
    (comp.lang.perl.tk)