Results 1 to 2 of 2
  1. #1
    ravrajesh.ap is offline Member
    Join Date
    Jan 2009
    Rep Power

    Default i want to remove JScrollPane from panel


    how to remove jscrollpane from panel/frame?

    J panel center = new Jpanel();
    JScrollPane paneReg = new JScrollPane(center); frame.getContentPane().add(paneReg);

    by using the above code we can added.

    but how can we remove?

    Thanks in advance.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power


    simply calling remove will do this. You'll need to call revalidate on the contentPane (cast as a JPanel) and repaint on it as well.

    If this doesn't work, then your best bet here is to show us compilable code. We don't want to see your whole program, but rather you should condense your code into the smallest bit that still compiles, has no extra code that's not relevant to your problem, but still demonstrates your problem, in other words, an SSCCE (Short, Self Contained, Correct (Compilable), Example). For more info on SSCCEs please look here:


    Again, if the code is compilable and runnable more people will be able to help you.

    Also, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, you will need to paste already formatted code into the forum, highlight this code, and then press the "code" button at the top of the forum Message editor prior to posting the message. Another way is to place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:

    Java Code:
      // your code block goes here.
      // note the differences between the tag at the top vs the bottom.
    Good luck

Similar Threads

  1. [SOLVED] JScrollPane - HELP!
    By terox13 in forum AWT / Swing
    Replies: 8
    Last Post: 05-10-2008, 04:58 AM
  2. JScrollPane with HTML
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-14-2008, 12:32 PM
  3. jscrollpane problem
    By monkey04 in forum AWT / Swing
    Replies: 2
    Last Post: 01-19-2008, 06:23 AM
  4. help with JScrollPane
    By tommy in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 08:58 PM
  5. JScrollPane not scrolling
    By Riftwalker in forum Advanced Java
    Replies: 2
    Last Post: 07-17-2007, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts