Guest User

Untitled

a guest
Apr 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import java.awt.*;
  2. import javax.swing.*;
  3.  
  4. public class MainFrame extends JFrame {
  5.  
  6. /**
  7. * @param args
  8. */
  9. public static void main(String[] args) {
  10. new MainFrame();
  11. }
  12.  
  13. public MainFrame() {
  14. super("hello");
  15. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  16.  
  17. JPanel viewport = new JPanel();
  18. viewport.setLayout(new BorderLayout());
  19. viewport.add(new JButton("Filler"), BorderLayout.CENTER);
  20. add(viewport, BorderLayout.CENTER);
  21.  
  22. JPanel itemsContainer = new JPanel();
  23. itemsContainer.setPreferredSize(new Dimension(200, 100));
  24. itemsContainer.add(new JButton("TOP"), BorderLayout.PAGE_START);;
  25. itemsContainer.add(new JButton("BTM"), BorderLayout.PAGE_END);;
  26. add(itemsContainer, BorderLayout.LINE_END);
  27.  
  28. pack();
  29. setVisible(true);
  30. }
  31. }
Add Comment
Please, Sign In to add comment