Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. JScrollPane is not showing the frame properly

JScrollPane is not showing the frame properly

Scheduled Pinned Locked Moved Java
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chdboy
    wrote on last edited by
    #1

    I have this code in which I have

    JTabbedPane tabbedPane = new JTabbedPane();

    and I have

    JScrollPane scroll_pane = new JScrollPane(tabbedPane);

    But when the JFrame shows up it is blank and after I click the maximize (Window) button it shows up the content on the frame. why is this happening?

    frame.setPreferredSize(new Dimension(1500, 1210));

        frame.setDefaultCloseOperation(JFrame.DISPOSE\_ON\_CLOSE);
        frame.pack();
        frame.setResizable(true);
        frame.setVisible(true);
    
    S 1 Reply Last reply
    0
    • C chdboy

      I have this code in which I have

      JTabbedPane tabbedPane = new JTabbedPane();

      and I have

      JScrollPane scroll_pane = new JScrollPane(tabbedPane);

      But when the JFrame shows up it is blank and after I click the maximize (Window) button it shows up the content on the frame. why is this happening?

      frame.setPreferredSize(new Dimension(1500, 1210));

          frame.setDefaultCloseOperation(JFrame.DISPOSE\_ON\_CLOSE);
          frame.pack();
          frame.setResizable(true);
          frame.setVisible(true);
      
      S Offline
      S Offline
      Shubhashish_Mandal
      wrote on last edited by
      #2

      To add anything in scrollPane , try this

      jscrollpane.setViewPortView(...)

      Regards Shubhashish

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups