List of usage examples for java.awt.event ContainerEvent getChild
public Component getChild()
From source file:org.openestate.tool.helloworld.HelloWorldObjectViewPanel.java
@Override protected void tabComponentRemoved(ContainerEvent e) { super.tabComponentRemoved(e); Component c = e.getChild(); if (c instanceof AbstractTab) { ((AbstractTab) c).setViewPanel(null); }//from w w w . j a v a 2 s .co m }
From source file:the.bytecode.club.bytecodeviewer.gui.WorkPane.java
public WorkPane(final FileChangeNotifier fcn) { super("WorkPanel"); setTitle("Work Space"); this.tabs = new JTabbedPane(); this.fcn = fcn; getContentPane().setLayout(new BorderLayout()); getContentPane().add(tabs, BorderLayout.CENTER); buttonPanel = new JPanel(new FlowLayout()); refreshClass = new JButton("Refresh"); refreshClass.addActionListener(this); buttonPanel.add(refreshClass);// w w w . j a va2 s . co m //Xposed generateXposedClass = new JButton("Generate Xposed Module"); generateXposedClass.addActionListener(this); buttonPanel.add(generateXposedClass); buttonPanel.setVisible(false); getContentPane().add(buttonPanel, BorderLayout.SOUTH); tabs.addContainerListener(new ContainerListener() { @Override public void componentAdded(final ContainerEvent e) { } @Override public void componentRemoved(final ContainerEvent e) { final Component c = e.getChild(); if (c instanceof ClassViewer) { ClassViewer cv = (ClassViewer) c; workingOn.remove(cv.container + "$" + cv.name); } if (c instanceof FileViewer) { FileViewer fv = (FileViewer) c; workingOn.remove(fv.container + "$" + fv.name); } } }); tabs.addChangeListener(new ChangeListener() { @Override public void stateChanged(final ChangeEvent arg0) { buttonPanel.setVisible(tabs.getSelectedIndex() != -1); } }); this.setVisible(true); }