All pastes #955386 Raw Edit

Miscellany

public java v1 · immutable
#955386 ·published 2008-03-24 16:22 UTC
rendered paste body
/*   CUT HERE*/import java.awt.* ; import java.util.Vector;import javax.swing.* ;import javax.swing.table.AbstractTableModel;public class Main {    public static void main(String[] args) {                JFrame window = new App() ;         window.setVisible(true);            }}class App extends JFrame  {       protected JTable table ;     protected JButton addButton ;     protected JButton deleteButton ;        App()    {        Container content = getContentPane() ;         setSize(400, 200) ;         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        content.setLayout(new BorderLayout());                 table = new JTable() ;           JPanel rightPanel = new JPanel() ;         JScrollPane scrollPane = new JScrollPane(table) ;         table.setFillsViewportHeight(true);           content.add(scrollPane, BorderLayout.CENTER) ;        addButton = new JButton("Add CD") ;         deleteButton = new JButton("Delete CD") ;         rightPanel.setLayout(new GridBagLayout())  ;        GridBagConstraints c = new GridBagConstraints() ;        c.fill = GridBagConstraints.VERTICAL ;         c.gridx = 0 ;        c.gridy = 0 ;           rightPanel.add(addButton, c) ;         c.gridy = 1 ;        rightPanel.add(deleteButton,c) ;          content.add(rightPanel, BorderLayout.LINE_END) ;    }   }