Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3.  
  4. /**
  5. * Created by Admin on 17.11.2017.
  6. */
  7. public class OwnerTable extends JFrame {
  8. private OwnerTableModel ownerTableModel = new OwnerTableModel();
  9. private JTable ownerTable = new JTable(ownerTableModel);
  10. private JScrollPane ownerTableScroll = new JScrollPane(ownerTable);
  11.  
  12. public OwnerTable(){
  13. super("Owner table");
  14. this.setSize(new Dimension(960, 540));
  15. this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  16. this.setLocationRelativeTo(null);
  17.  
  18. Container container = this.getContentPane();
  19. container.setLayout(new GridBagLayout());
  20.  
  21. ownerTableScroll.setPreferredSize(new Dimension(400, 400));
  22. ownerTable.getTableHeader().setReorderingAllowed(false);
  23.  
  24. container.add(ownerTableScroll,
  25. new GridBagConstraints(0, 0, 1, 5, 20, 1,
  26. GridBagConstraints.NORTH,
  27. GridBagConstraints.BOTH,
  28. new Insets(1, 1, 1, 1), 0, 0));
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement