public ViewHolder(String id, String loc, JSplitPane sp) { this.loc = loc; this.splitPane = sp; setLayout(new BorderLayout()); //setMinimumSize(new Dimension(5, 5)); addContainerListener(new ContainerListener() { public void componentAdded(ContainerEvent e) { if (getComponentCount() == 1) { splitPane.add(ViewHolder.this, ViewHolder.this.loc); } } public void componentRemoved(ContainerEvent e) { if (getComponentCount() == 0) { splitPane.remove(ViewHolder.this); } } }); createHolder(); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); }
public ViewHolder(String id, String loc, JSplitPane sp) { this.loc = loc; this.splitPane = sp; setLayout(new BorderLayout()); //setMinimumSize(new Dimension(5, 5)); addContainerListener(new ContainerListener() { public void componentAdded(ContainerEvent e) { if (getComponentCount() == 1) { splitPane.add(ViewHolder.this, ViewHolder.this.loc); } } public void componentRemoved(ContainerEvent e) { if (getComponentCount() == 0) { splitPane.remove(ViewHolder.this); } } }); createHolder(); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); }
public ViewHolder(String id, String loc, JSplitPane sp) { this.loc = loc; this.splitPane = sp; setLayout(new BorderLayout()); //setMinimumSize(new Dimension(5, 5)); addContainerListener(new ContainerListener() { public void componentAdded(ContainerEvent e) { if (getComponentCount() == 1) { splitPane.add(ViewHolder.this, ViewHolder.this.loc); } } public void componentRemoved(ContainerEvent e) { if (getComponentCount() == 0) { splitPane.remove(ViewHolder.this); } } }); createHolder(); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); }