Advertisement
jeje_oh

launcherFrame.java

Dec 8th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. package fr.jejeoh.launcher.minecraft;
  2.  
  3. import javax.swing.JFrame;
  4. import javax.swing.UIManager;
  5. import javax.swing.UnsupportedLookAndFeelException;
  6.  
  7. import fr.theshark34.swinger.Swinger;
  8. import fr.theshark34.swinger.util.WindowMover;
  9.  
  10. @SuppressWarnings("serial")
  11. public class LauncherFrame extends JFrame {
  12.  
  13. private static LauncherFrame instance;
  14. private LauncherPanel launcherPanel;
  15.  
  16. public LauncherFrame() {
  17. this.setTitle("OLTANAMC");
  18. this.setSize(975, 625);
  19. this.setDefaultCloseOperation(EXIT_ON_CLOSE);
  20. this.setLocationRelativeTo(null);
  21. this.setUndecorated(true);
  22. this.setIconImage(Swinger.getResource("icon.png"));
  23. this.setContentPane(launcherPanel = new LauncherPanel());
  24.  
  25. WindowMover mover = new WindowMover(this);
  26. this.addMouseListener(mover);
  27. this.addMouseMotionListener(mover);
  28.  
  29. this.setVisible(true);
  30. }
  31.  
  32. public static void main(String[] args) {
  33. try {
  34. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  35. } catch (ClassNotFoundException e) {
  36. // TODO Auto-generated catch block
  37. e.printStackTrace();
  38. } catch (InstantiationException e) {
  39. // TODO Auto-generated catch block
  40. e.printStackTrace();
  41. } catch (IllegalAccessException e) {
  42. // TODO Auto-generated catch block
  43. e.printStackTrace();
  44. } catch (UnsupportedLookAndFeelException e) {
  45. // TODO Auto-generated catch block
  46. e.printStackTrace();
  47. }
  48. //stop gros truc
  49. Swinger.setResourcePath("/fr/jejeoh/launcher/minecraft/resources/");
  50.  
  51. instance = new LauncherFrame();
  52.  
  53. }
  54.  
  55. public static LauncherFrame getInstance() {
  56. return instance;
  57. }
  58. public LauncherPanel getLauncherPanel() {
  59. return this.launcherPanel;
  60. }
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement