Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package teopi4a;
- import java.awt.BorderLayout;
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.border.EmptyBorder;
- import javax.swing.JTextField;
- import javax.swing.JButton;
- import java.awt.event.ActionListener;
- import java.util.Date;
- import java.awt.event.ActionEvent;
- import javax.swing.UIManager;
- import java.awt.Color;
- public class Teooooooooooooooooooooooooooooooooooooooooooooooooo1 extends JFrame {
- private JPanel contentPane;
- private JTextField txtField;
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- Teooooooooooooooooooooooooooooooooooooooooooooooooo1 frame = new Teooooooooooooooooooooooooooooooooooooooooooooooooo1();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- */
- public Teooooooooooooooooooooooooooooooooooooooooooooooooo1() {
- setTitle("\u0417\u043E\u0434\u0438\u044F");
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 200, 158);
- contentPane = new JPanel();
- contentPane.setBackground(Color.GREEN);
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(null);
- txtField = new JTextField();
- txtField.setBounds(20, 22, 158, 20);
- contentPane.add(txtField);
- txtField.setColumns(10);
- JButton btnNewButton = new JButton("\u0412\u044A\u0432\u0435\u0434\u0438");
- btnNewButton.setForeground(Color.GREEN);
- btnNewButton.setBackground(Color.BLACK);
- btnNewButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- String egn = txtField.getText();
- int god = Integer.valueOf(egn.substring(0, 2));
- int month = Integer.valueOf(egn.substring(2, 4));
- if (month > 40) {
- month -= 40;
- year += 2000;
- } else if (month > 20) {
- month -= 20;
- year += 1800;
- } else {
- year += 1900;
- }
- int day = Integer.valueOf(egn.substring(4, 6));
- String zodia = "null";
- if ((month ==12 && day>=22 && day<=31)||(month==1 && day>=1 && day<=19))
- zodia = "Capricorn";
- else if ((month==1 && day>=20 && day<=31)||(month==2 && day>=1 && day<=17))
- zodia = "Aquarius";
- else if ((month==2 && day>=18 && day<=29)||(month==3 && day>=1 && day<=19))
- zodia = "Pisces";
- else if ((month==3 && day>=20 && day<=31)||(month ==4 && day>=1 && day<=19))
- zodia = "Aries";
- else if ((month==4 && day>=20 && day<= 30)||(month==5 && day>=1 && day<=20))
- zodia = "Taurus";
- else if ((month==5 && day>=21&& day<=31)||(month==6 && day>=1 && day<=20))
- zodia = "Gemini";
- else if ((month==6 && day>=21 && day<=30)||(month==7 && day>=1 && day<=22))
- zodia = "Cancer";
- else if ((month==7 && day>=23 && day<=31)||(month==8 && day>=1 && day<=22))
- zodia = "Leo";
- else if ((month==8 && day>=23 && day<=31)||(month==9 && day>=1 && day<=22))
- zodia = "Virgo";
- else if ((month==9 && day>=23 && day<=30)||(month==10 && day>=1 && day<=22))
- zodia = "Libra";
- else if ((month==10 && day>=23 && day<=31)||(month==11 && day>=1 && day<=21))
- zodia = "Scorpio";
- else if ((month==11 && day>=22 && day<=30)||(month==12 && day>=1 && day<=21))
- zodia = "Sagittarius";
- JOptionPane.showMessageDialog(contentPane, zodia);
- }
- });
- btnNewButton.setBounds(54, 78, 91, 23);
- contentPane.add(btnNewButton);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement