JScrollPane not appearing

From: Taras_96 (tagas96_at_hotmail.com)
Date: 11/26/03

  • Next message: Shripathi Kamath: "Question on JFreeChart and Batik"
    Date: 25 Nov 2003 17:10:54 -0800
    
    

    Hi all,

    as the subject line appears, the JScrollPane doesn't appear when the
    JPanel in its veiw port becomes bigger than the scroll pane. Does
    anyone see anything obviously wrong with this code?

    JFrame myFrame1 = new JFrame();
    Container contentPane1 = myFrame1.getContentPane();
    myFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    String [] labels = {"Sas","asd", "asdf", "aew"};
    Grapher myGrapher = new Grapher(labels);
    JScrollPane pane1 = new JScrollPane();
    pane1.setViewportView(myGrapher);
    contentPane1.add(pane1);
    myFrame1.show();

    Grapher is a class that extends JPanel and overrides the
    paintComponent (Graphics g) method..

    Cheers

    Taras


  • Next message: Shripathi Kamath: "Question on JFreeChart and Batik"

    Relevant Pages

    • =?iso-8859-1?q?Re:_JPanel_l=E4uft_=FCber_JScrollPane_-_kein_scrollen?=
      ... public class Fehler extends JFrame implements ActionListener, ... private JPanel jp_Rechts2 = new JPanel; ... private JScrollPane jscrollpaneL = new JScrollPane; ... Next by Date: ...
      (de.comp.lang.java)
    • Re: Problem mit JScrollPane und einem Bild in JTabbedPane
      ... > Ich versuche momentan in einem JTabbedPane ein Bild mit JScrollPane zu ... > private JPanel plInfo = new JPanel; ...
      (de.comp.lang.java)
    • Layout Problem mit 2 JScrollPanes nebeneinander
      ... ich schlage mich jetzt seit etwa 2 Abenden mit einem Problem bei der Darstellung von 2 JScrollPane herum, ... TestDialog1 dlg = new TestDialog1; ... JPanel actions = new JPanel; ... Component comp = super.getListCellRendererComponent; ...
      (de.comp.lang.java)
    • JScrollPane doesnt scroll a JPanel?
      ... I've never had problems with JScrollPane like I'm running into here... ... I am trying to create a Swing UI for VNC, ... JPanel. ... The inner JPanel implements getPreferredSize, ...
      (comp.lang.java.gui)
    • Re: positioning within a JScrollPane
      ... the JPanel within it is shorter than the full height, ... JScrollPane. ... MyPanel panel = new MyPanel; ... ScrollableJPanelDemo sjpd = new ScrollableJPanelDemo; ...
      (comp.lang.java.gui)