Advertisement
apl-mhd

Sadia

Dec 30th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.62 KB | None | 0 0
  1. package com.company;
  2.  
  3. import javafx.embed.swing.JFXPanel;
  4. import sun.awt.image.GifImageDecoder;
  5.  
  6. import javax.swing.*;
  7.  
  8. import java.awt.*;
  9.  
  10. import static com.sun.glass.ui.Cursor.setVisible;
  11.  
  12. public class Main extends JFrame{
  13.  
  14.  
  15.  
  16.      Main(){
  17.  
  18.         setTitle("Apel");
  19.  
  20.          GridLayout gridLayout = new GridLayout(5,1);
  21.         setLayout(new BorderLayout(10,10));
  22.  
  23.         JPanel jPanel = new JPanel(gridLayout);
  24.  
  25.         JLabel jLabel = new JLabel("apel");
  26.         JButton button[] = new JButton[5];
  27.  
  28.         button[0] = new JButton("NORTH");
  29.          button[1] = new JButton("south");
  30.          button[2] = new JButton("East");
  31.          button[3] = new JButton("west");
  32.          button[4] = new JButton("Center");
  33.  
  34.  
  35.          //JLabel jLabel1 = new JLabel("apel");
  36.          JButton button1[] = new JButton[5];
  37.  
  38.          button1[0] = new JButton("NORTH");
  39.          button1[1] = new JButton("south");
  40.          button1[2] = new JButton("East");
  41.          button1[3] = new JButton("west");
  42.          button1[4] = new JButton("Center");
  43.  
  44.          jPanel.add(button1[0]);
  45.          jPanel.add(button1[1]);
  46.          jPanel.add(button1[2]);
  47.          jPanel.add(button1[3]);
  48.          jPanel.add(button1[4]);
  49.  
  50.  
  51.  
  52.          add(button[0],BorderLayout.NORTH);
  53.         add(button[1],BorderLayout.SOUTH);
  54.          add(button[2],BorderLayout.EAST);
  55.          add(button[3],BorderLayout.WEST);
  56.          add(jPanel,BorderLayout.CENTER);
  57.  
  58.  
  59.        setSize(400,400);
  60.         setVisible(true);
  61.  
  62.     }
  63.  
  64.     public static void main(String[] args) {
  65.     // write your code here
  66.  
  67.       Main main =new Main();
  68.  
  69.  
  70.  
  71.  
  72.     }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement