Select Git revision
ApplicationMain.java
Forked from
Ho Dac Hai / COMP90015-DSAss2-InfinityMonkeys-remaster
Source project has a limited visibility.
ApplicationMain.java 1.14 KiB
package GUI;
import client.Client;
import javax.swing.*;
import java.awt.*;
public class ApplicationMain extends JPanel {
Client client;
ChatScreen chatScreen;
PaintGUI paintGUI;
JFrame frame;
public ChatScreen getChatScreen() { return chatScreen; }
public PaintGUI getPaintGUI() { return paintGUI; }
public JFrame getFrame() {
return frame;
}
public ApplicationMain(Client client) {
this.client = client;
this.chatScreen = new ChatScreen(client);
this.paintGUI = new PaintGUI(client);
}
public void createAndShowGUI() {
frame = new JFrame("Application Main");
JFrame.setDefaultLookAndFeelDecorated(true);
Container content = frame.getContentPane();
content.setLayout(new BorderLayout());
content.add(paintGUI.getGlobal(), BorderLayout.WEST);
content.add(chatScreen.panel2, BorderLayout.EAST);
frame.setSize(1200, 700);
frame.setLocationRelativeTo( null );
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}