🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12500

JScrollpane and JTable

#12500
From: Nadia Akrour
Date: Tue, 15 Dec 1998 00:00
23 lines
1147 bytes
Hi all,
I have added a JTable inside a JScrollPane like this :

JTable table = new JTable();
JScrollpane scrollpane = new JScrollpane(table);

Now I want to remove the jtable and add a JPanel instead to the
scrollpane.
I tried this :

      JPanel panel = new JPanel();
      panel.add(new JLabel("hello"));
      scrollpane.getViewport().remove(table);
      scrollpane.getViewport().removeNotify();
      scrollpane.getViewport().repaint();
      scrollpane.getViewport().add(panel);

the table is removed but I can't see the added panel.
Am I doing something wrong ? Please some help would be very appreciated
!!
Thanks.

Nadia.
Technical Details
Message-ID: <36769DA6.AFA81B38@spring.fr>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,13833af79de51367,start
X-Google-Attributes: gid111d45,public
From: Nadia Akrour <akrour@spring.fr>
Subject: JScrollpane and JTable
Date: 1998/12/15
Message-ID: <36769DA6.AFA81B38@spring.fr>
X-Deja-AN: 422558923
Content-Transfer-Encoding: 7bit
X-Accept-Language: fr-FR,en
Content-Type: text/plain; charset=us-ascii
Organization: SPRING TECHNOLOGIES
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing