/
Bananka_ana
/
help
Обзор
Документация
Войти
/
Bananka_ana
/
help
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
BadenBadenApp.java
770 строк
34 KB
Bananka_ana
upload files
27 апр 2025, 18:45
27 апр 2025, 18:45
391128e
Код
Авторство
О чём код?
import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.net.URI; import java.time.LocalDateTime; import java.util.Random; public class BadenBadenApp { private JFrame mainFrame; private Color fiol = new Color(180, 136, 242); private Color t_sin = new Color(14, 13, 64); private Color sin = new Color(28, 63, 166); private Color roz = new Color(252, 185, 254); private Color gol = new Color(109, 130, 253); private Color wh = Color.WHITE; private Color sv_roz = new Color(251, 231, 252); private Color bl = Color.BLACK; private boolean darkMode = false; private Random random = new Random(); private LocalDateTime now = LocalDateTime.now(); public BadenBadenApp() { // Create main window mainFrame = new JFrame("ФИИТ УрФУ"); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.setSize(1022, 616); mainFrame.setLayout(null); mainFrame.setResizable(false); mainFrame.getContentPane().setBackground(wh); // Create menu createMenu(); // Create main content createMainContent(); // Create contacts section createContactsSection(); // Create social media section createSocialSection(); // Add theme toggle button addThemeToggleButton(); mainFrame.setVisible(true); } private void createMenu() { // History button JButton historyBtn = createMenuButton("История", 47, 0, 80, 50); historyBtn.addActionListener(e -> openHistoryWindow()); // Program button JButton programBtn = createMenuButton("Программа", 174, 0, 100, 50); programBtn.addActionListener(e -> openProgramWindow()); // Teachers button JButton teachersBtn = createMenuButton("Преподаватели", 321, 0, 130, 50); teachersBtn.addActionListener(e -> openTeachersWindow()); // Internships button JButton internshipsBtn = createMenuButton("Стажировки", 498, 0, 100, 50); internshipsBtn.addActionListener(e -> openInternshipsWindow()); // Reviews button JButton reviewsBtn = createMenuButton("Отзывы", 645, 0, 70, 50); reviewsBtn.addActionListener(e -> openReviewsWindow()); // Paid education button JButton paidEduBtn = createMenuButton("Платное обучение", 762, 0, 150, 50); paidEduBtn.addActionListener(e -> openPaidEducationWindow()); } private void openPaidEducationWindow() { } private void openReviewsWindow() { } private void openInternshipsWindow() { } private JButton createMenuButton(String text, int x, int y, int width, int height) { JButton button = new JButton(text); button.setBounds(x, y, width, height); button.setForeground(fiol); button.setBackground(wh); button.setFont(new Font("Segoe UI", Font.PLAIN, 14)); button.setBorderPainted(false); button.setFocusPainted(false); button.setContentAreaFilled(false); // Hover effects button.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { button.setForeground(darkMode ? wh : t_sin); if (darkMode && (text.equals("История") || text.equals("Отзывы") || text.equals("Платное обучение") || text.equals("Программа") || text.equals("Стажировки") || text.equals("Преподаватели"))) { button.setForeground(gol); } } @Override public void mouseExited(MouseEvent e) { button.setForeground(fiol); } }); mainFrame.add(button); return button; } private void createMainContent() { // Logo ImageIcon logoIcon = new ImageIcon("logo.png"); JLabel logoLabel = new JLabel(logoIcon); logoLabel.setBounds(25, 55, logoIcon.getIconWidth(), logoIcon.getIconHeight()); mainFrame.add(logoLabel); // Main title JLabel titleLabel = new JLabel("IT-направление на матмехе УрФУ"); titleLabel.setBounds(463, 35, 600, 165); titleLabel.setFont(new Font("Segoe UI", Font.PLAIN, 50)); titleLabel.setForeground(t_sin); mainFrame.add(titleLabel); // Description JTextArea description = new JTextArea( "ФИИТ - фундаментальная информатика и информационные\n" + "технологии. Готовим разработчиков, способных работать\n" + "в любой IT-компании. Направление курируют IT-компании\n" + "Контур, NAUMEN, Doubletapp, JetStyle и IT-сообщество\n" + "Екатеринбурга."); description.setBounds(466, 220, 600, 150); description.setFont(new Font("Arial", Font.PLAIN, 14)); description.setForeground(t_sin); description.setBackground(wh); description.setEditable(false); mainFrame.add(description); } private void createContactsSection() { JLabel contactsLabel = new JLabel("Связь с нами:"); contactsLabel.setBounds(466, 380, 150, 36); contactsLabel.setFont(new Font("Arial", Font.PLAIN, 15)); contactsLabel.setForeground(sin); mainFrame.add(contactsLabel); // Telegram ImageIcon tgIcon = new ImageIcon("tg.png"); JLabel tgLabel = new JLabel(tgIcon); tgLabel.setBounds(467, 416, tgIcon.getIconWidth(), tgIcon.getIconHeight()); mainFrame.add(tgLabel); JButton tgBtn = createSocialButton("https://t.me/fiit_urfu", 536, 416, 170, 50); tgBtn.addActionListener(e -> openWebPage("https://t.me/fiit_urfu")); // VK ImageIcon vkIcon = new ImageIcon("vk.png"); JLabel vkLabel = new JLabel(vkIcon); vkLabel.setBounds(471, 476, vkIcon.getIconWidth(), vkIcon.getIconHeight()); mainFrame.add(vkLabel); JButton vkBtn = createSocialButton("vk.com/fiiturfu", 541, 476, 120, 50); vkBtn.addActionListener(e -> openWebPage("https://vk.com/fiiturfu")); // Email ImageIcon mailIcon = new ImageIcon("pochta.png"); JLabel mailLabel = new JLabel(mailIcon); mailLabel.setBounds(471, 536, mailIcon.getIconWidth(), mailIcon.getIconHeight()); mainFrame.add(mailLabel); JButton mailBtn = createSocialButton("fiit@kontur.ru", 544, 536, 110, 50); mailBtn.addActionListener(e -> openWebPage("mailto:fiit@kontur.ru")); } private void createSocialSection() { JLabel socialLabel = new JLabel("Мы в других соц. сетях:"); socialLabel.setBounds(741, 380, 250, 36); socialLabel.setFont(new Font("Arial", Font.PLAIN, 15)); socialLabel.setForeground(sin); mainFrame.add(socialLabel); // Website ImageIcon siteIcon = new ImageIcon("sait.png"); JLabel siteLabel = new JLabel(siteIcon); siteLabel.setBounds(741, 411, siteIcon.getIconWidth(), siteIcon.getIconHeight()); mainFrame.add(siteLabel); JButton siteBtn = createSocialButton("vk.com/mmabiturient", 820, 416, 175, 50); siteBtn.addActionListener(e -> openWebPage("https://vk.com/mmabiturient")); // YouTube ImageIcon ytIcon = new ImageIcon("youtube.png"); JLabel ytLabel = new JLabel(ytIcon); ytLabel.setBounds(746, 476, ytIcon.getIconWidth(), ytIcon.getIconHeight()); mainFrame.add(ytLabel); JButton ytBtn = createSocialButton("youtube.com/@user-ep1yj8gz7b", 823, 471, 175, 50); ytBtn.addActionListener(e -> openWebPage("https://www.youtube.com/channel/UC-dOXcKANMkRrChuUYML-FQ")); } private JButton createSocialButton(String text, int x, int y, int width, int height) { JButton button = new JButton(text); button.setBounds(x, y, width, height); button.setForeground(sin); button.setBackground(wh); button.setFont(new Font("Segoe UI", Font.PLAIN, 13)); button.setBorderPainted(false); button.setFocusPainted(false); button.setContentAreaFilled(false); button.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { button.setForeground(t_sin); } @Override public void mouseExited(MouseEvent e) { button.setForeground(sin); } }); mainFrame.add(button); return button; } private void addThemeToggleButton() { ImageIcon moonIcon = new ImageIcon("moon.png"); Image scaledMoon = moonIcon.getImage().getScaledInstance(25, 25, Image.SCALE_SMOOTH); moonIcon = new ImageIcon(scaledMoon); ImageIcon sunIcon = new ImageIcon("sun.png"); Image scaledSun = sunIcon.getImage().getScaledInstance(25, 25, Image.SCALE_SMOOTH); sunIcon = new ImageIcon(scaledSun); JButton themeBtn = new JButton(moonIcon); themeBtn.setBounds(945, 0, 50, 50); themeBtn.setBorderPainted(false); themeBtn.setContentAreaFilled(false); ImageIcon finalSunIcon = sunIcon; ImageIcon finalMoonIcon = moonIcon; themeBtn.addActionListener(e -> { toggleTheme(); themeBtn.setIcon(darkMode ? finalSunIcon : finalMoonIcon); }); mainFrame.add(themeBtn); } private void toggleTheme() { darkMode = !darkMode; if (darkMode) { // Dark theme wh = t_sin; t_sin = Color.WHITE; sin = gol; bl = Color.WHITE; gol = new Color(109, 130, 253); } else { // Light theme wh = Color.WHITE; t_sin = new Color(14, 13, 64); sin = new Color(28, 63, 166); bl = Color.BLACK; } updateColors(); } private void updateColors() { mainFrame.getContentPane().setBackground(wh); Component[] components = mainFrame.getContentPane().getComponents(); for (Component component : components) { if (component instanceof JLabel) { JLabel label = (JLabel) component; if (label.getText() != null) { if (label.getText().equals("IT-направление на матмехе УрФУ") || label.getText().equals("Связь с нами:") || label.getText().equals("Мы в других соц. сетях:")) { label.setForeground(darkMode ? Color.WHITE : t_sin); } } } else if (component instanceof JTextArea) { ((JTextArea) component).setForeground(darkMode ? Color.WHITE : t_sin); ((JTextArea) component).setBackground(wh); } else if (component instanceof JButton) { JButton button = (JButton) component; if (button.getText() != null) { if (button.getText().equals("https://t.me/fiit_urfu") || button.getText().equals("vk.com/fiiturfu") || button.getText().equals("fiit@kontur.ru") || button.getText().equals("vk.com/mmabiturient") || button.getText().equals("youtube.com/@user-ep1yj8gz7b")) { button.setForeground(darkMode ? gol : sin); } else { button.setForeground(fiol); } } } } } private void openWebPage(String url) { try { Desktop.getDesktop().browse(new URI(url)); } catch (Exception e) { e.printStackTrace(); JOptionPane.showMessageDialog(mainFrame, "Не удалось открыть ссылку: " + url, "Ошибка", JOptionPane.ERROR_MESSAGE); } } private void openHistoryWindow() { JFrame historyFrame = new JFrame("История развития ФИИТ"); historyFrame.setSize(645, 647); historyFrame.setLayout(null); historyFrame.setResizable(false); historyFrame.getContentPane().setBackground(wh); // Title JLabel titleLabel = new JLabel("Зарождение ФИИТ"); titleLabel.setBounds(10, 10, 300, 50); titleLabel.setFont(new Font("Arial", Font.PLAIN, 14)); titleLabel.setForeground(sin); titleLabel.setBackground(wh); historyFrame.add(titleLabel); // Description JTextArea description = new JTextArea( "Много лет мы постепенно улучшали IT-образование в бакалавриате УрФУ,\n" + "но у сторонней компании для этого не так много возможностей. В 2019 го-\n" + "ду направление ФИИТ на матмехе УрФУ перезапустил Контур в партнерстве\n" + "с NAUMEN, Jet Style и IT-сообществом Екатеринбурга. Концепт у нас доволь-\n" + "но простой: принять лучших студентов и уделить им столько внимания,\n" + "сколько есть не во всех топовых столичных вузах."); description.setBounds(10, 45, 620, 160); description.setFont(new Font("Segoe UI", Font.PLAIN, 13)); description.setForeground(t_sin); description.setBackground(wh); description.setEditable(false); description.setLineWrap(true); description.setWrapStyleWord(true); historyFrame.add(description); // Scores title JLabel scoresTitle = new JLabel("Баллы на ФИИТ"); scoresTitle.setBounds(10, 205, 750, 30); scoresTitle.setFont(new Font("Arial", Font.PLAIN, 14)); scoresTitle.setForeground(sin); scoresTitle.setBackground(wh); historyFrame.add(scoresTitle); // Scores image ImageIcon scoresIcon = new ImageIcon("balli.png"); JLabel scoresLabel = new JLabel(scoresIcon); scoresLabel.setBounds(10, 245, scoresIcon.getIconWidth(), scoresIcon.getIconHeight()); historyFrame.add(scoresLabel); historyFrame.setVisible(true); } private void openProgramWindow() { JFrame programFrame = new JFrame("Программа обучения 1 курс"); programFrame.setSize(610, 420); programFrame.setLayout(null); programFrame.setResizable(false); programFrame.getContentPane().setBackground(wh); // Course tabs JLabel firstCourse = new JLabel("1 КУРС"); firstCourse.setBounds(10, 10, 147, 30); firstCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); firstCourse.setForeground(bl); programFrame.add(firstCourse); JButton secondCourse = new JButton("2 КУРС"); secondCourse.setBounds(157, 10, 148, 30); secondCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); secondCourse.setForeground(fiol); secondCourse.setBorderPainted(false); secondCourse.setContentAreaFilled(false); secondCourse.addActionListener(e -> { programFrame.dispose(); openSecondCourseWindow(); }); programFrame.add(secondCourse); JButton thirdCourse = new JButton("3 КУРС"); thirdCourse.setBounds(305, 10, 147, 30); thirdCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); thirdCourse.setForeground(fiol); thirdCourse.setBorderPainted(false); thirdCourse.setContentAreaFilled(false); thirdCourse.addActionListener(e -> { programFrame.dispose(); openThirdCourseWindow(); }); programFrame.add(thirdCourse); JButton fourthCourse = new JButton("4 КУРС"); fourthCourse.setBounds(452, 10, 148, 30); fourthCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); fourthCourse.setForeground(fiol); fourthCourse.setBorderPainted(false); fourthCourse.setContentAreaFilled(false); fourthCourse.addActionListener(e -> { programFrame.dispose(); openFourthCourseWindow(); }); programFrame.add(fourthCourse); // Programming section JLabel programmingLabel = new JLabel("Программирование"); programmingLabel.setBounds(10, 50, 170, 30); programmingLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); programmingLabel.setForeground(wh); programmingLabel.setBackground(fiol); programmingLabel.setOpaque(true); programFrame.add(programmingLabel); // Programming subjects addSubjectWithMarker(programFrame, "Операционные системы", 15, 90, 280, 30); addSubjectWithMarker(programFrame, "Основы программирования на С#", 15, 130, 280, 30); addSubjectWithMarker(programFrame, "Язык Python", 15, 170, 280, 30); addSubjectWithMarker(programFrame, "Архитектура ЭВМ", 15, 210, 280, 30); // Non-programming subjects JLabel nonProgrammingLabel = new JLabel("Непрограммистские предметы"); nonProgrammingLabel.setBounds(325, 50, 250, 30); nonProgrammingLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); nonProgrammingLabel.setForeground(wh); nonProgrammingLabel.setBackground(fiol); nonProgrammingLabel.setOpaque(true); programFrame.add(nonProgrammingLabel); // Non-programming subjects list addSubjectWithMarker(programFrame, "Основы проектной деятельности", 330, 90, 270, 30); addSubjectWithMarker(programFrame, "Иностранный язык", 330, 130, 270, 30); addSubjectWithMarker(programFrame, "Рациональное мышление", 330, 170, 270, 30); addSubjectWithMarker(programFrame, "Философия", 330, 210, 270, 30); addSubjectWithMarker(programFrame, "Физкультура", 330, 250, 270, 30); addSubjectWithMarker(programFrame, "Основы продуктового дизайна", 330, 290, 270, 30); // Math section JLabel mathLabel = new JLabel("Математика"); mathLabel.setBounds(10, 250, 100, 30); mathLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); mathLabel.setForeground(wh); mathLabel.setBackground(fiol); mathLabel.setOpaque(true); programFrame.add(mathLabel); // Math subjects addSubjectWithMarker(programFrame, "Введение в математику", 15, 290, 280, 30); addSubjectWithMarker(programFrame, "Алгебра и геометрия", 15, 330, 280, 30); addSubjectWithMarker(programFrame, "Математический анализ", 15, 370, 280, 30); programFrame.setVisible(true); } private void openSecondCourseWindow() { JFrame secondCourseFrame = new JFrame("Программа обучения 2 курс"); secondCourseFrame.setSize(740, 610); secondCourseFrame.setLayout(null); secondCourseFrame.setResizable(false); secondCourseFrame.getContentPane().setBackground(wh); // Course tabs JButton firstCourse = new JButton("1 КУРС"); firstCourse.setBounds(10, 10, 177, 30); firstCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); firstCourse.setForeground(fiol); firstCourse.setBorderPainted(false); firstCourse.setContentAreaFilled(false); firstCourse.addActionListener(e -> { secondCourseFrame.dispose(); openProgramWindow(); }); secondCourseFrame.add(firstCourse); JLabel secondCourse = new JLabel("2 КУРС"); secondCourse.setBounds(187, 10, 178, 30); secondCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); secondCourse.setForeground(bl); secondCourseFrame.add(secondCourse); JButton thirdCourse = new JButton("3 КУРС"); thirdCourse.setBounds(365, 10, 177, 30); thirdCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); thirdCourse.setForeground(fiol); thirdCourse.setBorderPainted(false); thirdCourse.setContentAreaFilled(false); thirdCourse.addActionListener(e -> { secondCourseFrame.dispose(); openThirdCourseWindow(); }); secondCourseFrame.add(thirdCourse); JButton fourthCourse = new JButton("4 КУРС"); fourthCourse.setBounds(542, 10, 178, 30); fourthCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); fourthCourse.setForeground(fiol); fourthCourse.setBorderPainted(false); fourthCourse.setContentAreaFilled(false); fourthCourse.addActionListener(e -> { secondCourseFrame.dispose(); openFourthCourseWindow(); }); secondCourseFrame.add(fourthCourse); // Programming section JLabel programmingLabel = new JLabel("Программирование"); programmingLabel.setBounds(10, 50, 170, 30); programmingLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); programmingLabel.setForeground(wh); programmingLabel.setBackground(fiol); programmingLabel.setOpaque(true); secondCourseFrame.add(programmingLabel); // Programming subjects addSubjectWithMarker(secondCourseFrame, "Сети и протоколы Интернета", 15, 90, 400, 30); addSubjectWithMarker(secondCourseFrame, "Объектно-ориентированное программирование", 15, 130, 400, 30); addSubjectWithMarker(secondCourseFrame, "Язык Python", 15, 170, 400, 30); addSubjectWithMarker(secondCourseFrame, "Алгоритмы и структуры данных", 15, 210, 400, 30); addSubjectWithMarker(secondCourseFrame, "Основы веб-разработки", 15, 250, 400, 30); addSubjectWithMarker(secondCourseFrame, "Основы проектирования баз данных", 15, 290, 400, 30); addSubjectWithMarker(secondCourseFrame, "Основы компьютерной безопасности", 15, 330, 400, 30); // Non-programming subjects JLabel nonProgrammingLabel = new JLabel("Непрограммистские предметы"); nonProgrammingLabel.setBounds(445, 50, 250, 30); nonProgrammingLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); nonProgrammingLabel.setForeground(wh); nonProgrammingLabel.setBackground(fiol); nonProgrammingLabel.setOpaque(true); secondCourseFrame.add(nonProgrammingLabel); // Non-programming subjects list addSubjectWithMarker(secondCourseFrame, "Проектный практикум", 450, 90, 280, 30); addSubjectWithMarker(secondCourseFrame, "Создание программного продукта", 450, 130, 280, 30); addSubjectWithMarker(secondCourseFrame, "Психология и социология", 450, 170, 280, 30); addSubjectWithMarker(secondCourseFrame, "История", 450, 210, 280, 30); addSubjectWithMarker(secondCourseFrame, "Физкультура", 450, 250, 280, 30); addSubjectWithMarker(secondCourseFrame, "Публичные выступления", 450, 290, 280, 30); // Math section JLabel mathLabel = new JLabel("Математика"); mathLabel.setBounds(10, 370, 100, 30); mathLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); mathLabel.setForeground(wh); mathLabel.setBackground(fiol); mathLabel.setOpaque(true); secondCourseFrame.add(mathLabel); // Math subjects addSubjectWithMarker(secondCourseFrame, "Дискретная математика", 15, 410, 400, 30); addSubjectWithMarker(secondCourseFrame, "Математический анализ", 15, 450, 400, 30); addSubjectWithMarker(secondCourseFrame, "Теория вероятностей", 15, 490, 400, 30); addSubjectWithMarker(secondCourseFrame, "Математическая статистика", 15, 530, 400, 30); addSubjectWithMarker(secondCourseFrame, "Машинное обучение", 15, 570, 400, 30); secondCourseFrame.setVisible(true); } private void openThirdCourseWindow() { JFrame thirdCourseFrame = new JFrame("Программа обучения 3 курс"); thirdCourseFrame.setSize(640, 290); thirdCourseFrame.setLayout(null); thirdCourseFrame.setResizable(false); thirdCourseFrame.getContentPane().setBackground(wh); // Course tabs JButton firstCourse = new JButton("1 КУРС"); firstCourse.setBounds(10, 10, 155, 30); firstCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); firstCourse.setForeground(fiol); firstCourse.setBorderPainted(false); firstCourse.setContentAreaFilled(false); firstCourse.addActionListener(e -> { thirdCourseFrame.dispose(); openProgramWindow(); }); thirdCourseFrame.add(firstCourse); JButton secondCourse = new JButton("2 КУРС"); secondCourse.setBounds(165, 10, 155, 30); secondCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); secondCourse.setForeground(fiol); secondCourse.setBorderPainted(false); secondCourse.setContentAreaFilled(false); secondCourse.addActionListener(e -> { thirdCourseFrame.dispose(); openSecondCourseWindow(); }); thirdCourseFrame.add(secondCourse); JLabel thirdCourse = new JLabel("3 КУРС"); thirdCourse.setBounds(320, 10, 155, 30); thirdCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); thirdCourse.setForeground(bl); thirdCourseFrame.add(thirdCourse); JButton fourthCourse = new JButton("4 КУРС"); fourthCourse.setBounds(475, 10, 155, 30); fourthCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); fourthCourse.setForeground(fiol); fourthCourse.setBorderPainted(false); fourthCourse.setContentAreaFilled(false); fourthCourse.addActionListener(e -> { thirdCourseFrame.dispose(); openFourthCourseWindow(); }); thirdCourseFrame.add(fourthCourse); // Programming section JLabel programmingLabel = new JLabel("Программирование"); programmingLabel.setBounds(10, 50, 170, 30); programmingLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); programmingLabel.setForeground(wh); programmingLabel.setBackground(fiol); programmingLabel.setOpaque(true); thirdCourseFrame.add(programmingLabel); // Programming subjects addSubjectWithMarker(thirdCourseFrame, "Конкурентное программирование", 15, 90, 300, 30); addSubjectWithMarker(thirdCourseFrame, "Функциональное программирование", 15, 130, 300, 30); // Electives JLabel electivesLabel = new JLabel("Курсы по выбору"); electivesLabel.setBounds(10, 210, 145, 30); electivesLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); electivesLabel.setForeground(wh); electivesLabel.setBackground(Color.GRAY); electivesLabel.setOpaque(true); thirdCourseFrame.add(electivesLabel); // Non-programming subjects JLabel nonProgrammingLabel = new JLabel("Непрограммистские предметы"); nonProgrammingLabel.setBounds(345, 50, 250, 30); nonProgrammingLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); nonProgrammingLabel.setForeground(wh); nonProgrammingLabel.setBackground(fiol); nonProgrammingLabel.setOpaque(true); thirdCourseFrame.add(nonProgrammingLabel); // Non-programming subjects list addSubjectWithMarker(thirdCourseFrame, "Безопасность жизнедеятельности", 350, 90, 280, 30); addSubjectWithMarker(thirdCourseFrame, "Научно-исследовательская работа", 350, 130, 280, 30); addSubjectWithMarker(thirdCourseFrame, "Физкультура", 350, 170, 280, 30); addSubjectWithMarker(thirdCourseFrame, "Летняя практика", 350, 210, 280, 30); addSubjectWithMarker(thirdCourseFrame, "Проектный практикум", 350, 250, 280, 30); thirdCourseFrame.setVisible(true); } private void openFourthCourseWindow() { JFrame fourthCourseFrame = new JFrame("Программа обучения 4 курс"); fourthCourseFrame.setSize(530, 250); fourthCourseFrame.setLayout(null); fourthCourseFrame.setResizable(false); fourthCourseFrame.getContentPane().setBackground(wh); // Course tabs JButton firstCourse = new JButton("1 КУРС"); firstCourse.setBounds(10, 10, 127, 30); firstCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); firstCourse.setForeground(fiol); firstCourse.setBorderPainted(false); firstCourse.setContentAreaFilled(false); firstCourse.addActionListener(e -> { fourthCourseFrame.dispose(); openProgramWindow(); }); fourthCourseFrame.add(firstCourse); JButton secondCourse = new JButton("2 КУРС"); secondCourse.setBounds(137, 10, 128, 30); secondCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); secondCourse.setForeground(fiol); secondCourse.setBorderPainted(false); secondCourse.setContentAreaFilled(false); secondCourse.addActionListener(e -> { fourthCourseFrame.dispose(); openSecondCourseWindow(); }); fourthCourseFrame.add(secondCourse); JButton thirdCourse = new JButton("3 КУРС"); thirdCourse.setBounds(265, 10, 127, 30); thirdCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); thirdCourse.setForeground(fiol); thirdCourse.setBorderPainted(false); thirdCourse.setContentAreaFilled(false); thirdCourse.addActionListener(e -> { fourthCourseFrame.dispose(); openThirdCourseWindow(); }); fourthCourseFrame.add(thirdCourse); JLabel fourthCourse = new JLabel("4 КУРС"); fourthCourse.setBounds(392, 10, 128, 30); fourthCourse.setFont(new Font("Segoe UI", Font.PLAIN, 14)); fourthCourse.setForeground(bl); fourthCourseFrame.add(fourthCourse); // Graduation preparation JLabel graduationLabel = new JLabel("Подготовка к выпуску"); graduationLabel.setBounds(10, 50, 180, 30); graduationLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); graduationLabel.setForeground(wh); graduationLabel.setBackground(fiol); graduationLabel.setOpaque(true); fourthCourseFrame.add(graduationLabel); // Graduation subjects addSubjectWithMarker(fourthCourseFrame, "Научно-исследовательская работа", 15, 90, 330, 30); addSubjectWithMarker(fourthCourseFrame, "Подготовка и защита выпускной работы", 15, 130, 330, 30); addSubjectWithMarker(fourthCourseFrame, "Оформление выпускной работы", 15, 170, 330, 30); addSubjectWithMarker(fourthCourseFrame, "Госэкзамен", 15, 210, 330, 30); // Electives JLabel electivesLabel = new JLabel("Курсы по выбору"); electivesLabel.setBounds(375, 50, 145, 30); electivesLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14)); electivesLabel.setForeground(wh); electivesLabel.setBackground(Color.GRAY); electivesLabel.setOpaque(true); fourthCourseFrame.add(electivesLabel); fourthCourseFrame.setVisible(true); } private void addSubjectWithMarker(JFrame frame, String text, int x, int y, int width, int height) { // Add colored marker JLabel marker = new JLabel(); marker.setBounds(x - 5, y, 5, height); marker.setBackground(fiol); marker.setOpaque(true); frame.add(marker); // Add subject label JLabel subject = new JLabel(text); subject.setBounds(x, y, width, height); subject.setFont(new Font("Segoe UI", Font.PLAIN, 14)); subject.setForeground(t_sin); frame.add(subject); } private void openTeachersWindow() { JFrame teachersFrame = new JFrame("Знакомство с некоторыми преподавателями"); teachersFrame.setSize(830, 800); teachersFrame.setLayout(null); teachersFrame.setResizable(false); teachersFrame.getContentPane().setBackground(wh); // Teacher 1 JLabel teacher1Title = new JLabel("<html>Александр Георгиевич Гейн<br>Преподаватель курса \"Алгебра и геометрия\"</html>"); teacher1Title.setBounds(10, 0, 390, 60); // teacher1Title.setFont } }