Advertisement
enevlogiev

loading

Jan 30th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.71 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.FlowLayout;
  3. import java.awt.Font;
  4. import java.awt.GridLayout;
  5. import java.awt.LayoutManager;
  6. import java.awt.image.BufferedImage;
  7. import java.io.File;
  8. import java.io.IOException;
  9. import java.net.URISyntaxException;
  10.  
  11. import javax.imageio.ImageIO;
  12. import javax.swing.ImageIcon;
  13. import javax.swing.JFrame;
  14. import javax.swing.JLabel;
  15. import javax.swing.JPanel;
  16. import javax.swing.JTextArea;
  17.  
  18.  
  19. public class LoadingScreen extends JFrame {
  20.     private static final long serialVersionUID = 1L;
  21.     static JPanel loadingScreen =  new JPanel((LayoutManager) new FlowLayout(FlowLayout.LEFT));
  22.     static JPanel playersMenu = new JPanel();
  23.     public static JTextArea playersNames = new JTextArea("PlayerOne: \nPlayerTwo: ");
  24.     public static JTextArea selectNames = new JTextArea("Change Name\nChange Name");
  25.    
  26.     public static void main(String[] args) throws IOException, URISyntaxException {
  27.         new LoadingScreen();
  28.     }
  29.    
  30.     public LoadingScreen() throws IOException, URISyntaxException {
  31.         super ("Loading... ");
  32.         setSize(720,360);
  33.         setResizable(false);
  34.         setDefaultCloseOperation(EXIT_ON_CLOSE);
  35.         BufferedImage ttt = ImageIO.read(new File(getClass().getResource("ttt.png").toURI()));
  36.         JLabel image = new JLabel(new ImageIcon(ttt));
  37.         loadingScreen.setLayout(new GridLayout(0, 2));
  38.         playersNames.setFont(new Font("Verdana", Font.BOLD, 20));
  39.         playersNames.setEditable(false);
  40.         selectNames.setFont(new Font("Verdana", Font.BOLD, 20));
  41.         selectNames.setEnabled(true);
  42.         playersMenu.add(playersNames);
  43.         playersMenu.add(selectNames);
  44.         loadingScreen.setBackground(Color.WHITE);
  45.         loadingScreen.add(image);
  46.         loadingScreen.add(playersMenu);
  47.         add(loadingScreen);
  48.         setVisible(true);
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement