Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.FlowLayout;
- import java.awt.Font;
- import java.awt.GridLayout;
- import java.awt.LayoutManager;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import java.net.URISyntaxException;
- import javax.imageio.ImageIO;
- import javax.swing.ImageIcon;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JTextArea;
- public class LoadingScreen extends JFrame {
- private static final long serialVersionUID = 1L;
- static JPanel loadingScreen = new JPanel((LayoutManager) new FlowLayout(FlowLayout.LEFT));
- static JPanel playersMenu = new JPanel();
- public static JTextArea playersNames = new JTextArea("PlayerOne: \nPlayerTwo: ");
- public static JTextArea selectNames = new JTextArea("Change Name\nChange Name");
- public static void main(String[] args) throws IOException, URISyntaxException {
- new LoadingScreen();
- }
- public LoadingScreen() throws IOException, URISyntaxException {
- super ("Loading... ");
- setSize(720,360);
- setResizable(false);
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- BufferedImage ttt = ImageIO.read(new File(getClass().getResource("ttt.png").toURI()));
- JLabel image = new JLabel(new ImageIcon(ttt));
- loadingScreen.setLayout(new GridLayout(0, 2));
- playersNames.setFont(new Font("Verdana", Font.BOLD, 20));
- playersNames.setEditable(false);
- selectNames.setFont(new Font("Verdana", Font.BOLD, 20));
- selectNames.setEnabled(true);
- playersMenu.add(playersNames);
- playersMenu.add(selectNames);
- loadingScreen.setBackground(Color.WHITE);
- loadingScreen.add(image);
- loadingScreen.add(playersMenu);
- add(loadingScreen);
- setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement