Advertisement
Guest User

start.java

a guest
Sep 6th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. package com.polonez11212;
  2.  
  3. import javax.swing.*;
  4. import java.awt.*;
  5.  
  6. public class Start extends JFrame {
  7. //Tutaj ustawiamy frame i pierwsze panele z napisem start
  8.  
  9.  
  10. // J-Obiekty itd
  11.  
  12. Fonts fonts= new Fonts();
  13. Colors colors= new Colors();
  14. JLabel titleTextLabel, titleTextShadow;
  15. JButton titleButton;
  16. StartButtonHandler startButtonHandler=new StartButtonHandler(this);
  17.  
  18. Start(){
  19. this.setTitle("Ascending Darkness");
  20. this.setSize(1000,800);
  21. this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  22. this.setLayout(null);
  23. this.setLocationRelativeTo(null);
  24. this.getContentPane().setBackground(Color.darkGray);
  25. this.setFocusable(true);
  26.  
  27.  
  28.  
  29. setUpStart();
  30.  
  31. this.setVisible(true);
  32. }
  33.  
  34. private void setUpStart(){
  35. new Fonts();
  36. titleTextLabel=new JLabel();
  37. titleTextLabel.setBounds(200,150,600,150);
  38. titleTextLabel.setFont(fonts.titleFont);
  39. titleTextLabel.setForeground(colors.titleColor);
  40. // titleTextLabel.setForeground(new Color(255,50,50));
  41. titleTextLabel.setHorizontalAlignment(JLabel.CENTER);
  42. titleTextLabel.setVerticalAlignment(JLabel.CENTER);
  43. titleTextLabel.setText("ASCENDING DARKNESS");
  44. // titleTextLabel.setOpaque(true);
  45. titleTextLabel.setBackground(Color.WHITE);
  46. this.add(titleTextLabel);
  47.  
  48.  
  49.  
  50. titleTextShadow=new JLabel();
  51. titleTextShadow.setBounds(210,165,600,150);
  52. titleTextShadow.setFont(fonts.titleFont);
  53. titleTextShadow.setForeground(colors.titleShadowColor);
  54. titleTextShadow.setHorizontalAlignment(JLabel.CENTER);
  55. titleTextShadow.setVerticalAlignment(JLabel.CENTER);
  56. titleTextShadow.setText("ASCENDING DARKNESS");
  57. // titleTextLabel.setOpaque(true);
  58. titleTextShadow.setBackground(Color.WHITE);
  59. this.add(titleTextShadow);
  60.  
  61.  
  62.  
  63. titleButton= new JButton("S T A R T");
  64. titleButton.setHorizontalAlignment(JButton.CENTER);
  65. titleButton.setVerticalAlignment(JButton.CENTER);
  66. titleButton.setBounds(400,500,200,100);
  67. titleButton.setFocusPainted(false);
  68. titleButton.setBackground(Color.lightGray);
  69. titleButton.setBorder(null);
  70. titleButton.addActionListener(startButtonHandler);
  71. titleButton.setForeground(colors.titleColor);
  72. titleButton.setFont(fonts.titleButtonFont);
  73. this.add(titleButton);
  74.  
  75.  
  76.  
  77. }
  78. }
  79.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement