1111import java .awt .*;
1212import java .awt .event .ActionEvent ;
1313import java .awt .event .KeyEvent ;
14+ import java .awt .event .MouseAdapter ;
15+ import java .awt .event .MouseEvent ;
1416import java .io .File ;
1517import java .io .InputStream ;
18+ import java .net .URI ;
1619
1720@ Getter
1821public class MainFrame extends JFrame {
@@ -27,13 +30,13 @@ public MainFrame() {
2730 setTitle ("Skidfuscator" );
2831 setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
2932 setPreferredSize (new Dimension (900 , 700 ));
30-
31- // Create main layout with increased padding
3233 setLayout (new BorderLayout (15 , 5 ));
3334
34- // Add header with logo
35+ // Create a panel for the left side that will contain both tabbed pane and button
36+ JPanel leftPanel = new JPanel (new BorderLayout ());
37+ leftPanel .setPreferredSize (new Dimension (180 , getHeight ()));
3538
36- JPanel tabbedPanel = new JPanel ( new BorderLayout ());
39+ // Create the tabbed pane
3740 tabbedPane = new JTabbedPane (JTabbedPane .LEFT ) {
3841 @ Override
3942 public void updateUI () {
@@ -47,13 +50,12 @@ protected Insets getTabAreaInsets(int tabPlacement) {
4750
4851 @ Override
4952 protected int calculateTabAreaWidth (int tabPlacement , int horizRunCount , int maxTabWidth ) {
50- return 160 ;
53+ return 180 ;
5154 }
5255
5356 @ Override
5457 protected int calculateTabWidth (int tabPlacement , int tabIndex , FontMetrics metrics ) {
55- // Make tabs fill the entire width of the tab area
56- return 160 ;
58+ return 180 ;
5759 }
5860
5961 @ Override
@@ -64,24 +66,24 @@ protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
6466 if (logoStream != null ) {
6567 Image logo = ImageIO .read (logoStream );
6668 Image scaledLogo = logo .getScaledInstance (150 , 150 , Image .SCALE_SMOOTH );
67- g .drawImage (scaledLogo , 5 , 10 , null );
69+ g .drawImage (scaledLogo , 20 , 10 , null );
6870 }
6971
7072 // Draw separator line
7173 g .setColor (Color .DARK_GRAY );
72- g .drawLine (5 , 155 , 155 , 155 );
74+ g .drawLine (5 , 155 , 175 , 155 );
7375
7476 // Draw version info
7577 g .setColor (new Color (200 ,190 ,220 ));
7678 g .setFont (new Font ("Segoe UI" , Font .BOLD , 11 ));
77- g .drawString ("Skidfuscator Community" , 10 , 175 );
79+ g .drawString ("Skidfuscator Community" , 20 , 175 );
7880 g .setColor (new Color (130 , 130 , 130 ));
7981 g .setFont (new Font ("Segoe UI" , Font .ITALIC , 11 ));
80- g .drawString ("Build: 2023.1" , 10 , 190 );
82+ g .drawString ("Build: 2023.1" , 20 , 190 );
8183
8284 // Draw second separator
8385 g .setColor (Color .DARK_GRAY );
84- g .drawLine (5 , 205 , 155 , 205 );
86+ g .drawLine (5 , 205 , 175 , 205 );
8587
8688 } catch (Exception e ) {
8789 e .printStackTrace ();
@@ -91,70 +93,121 @@ protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
9193 });
9294 }
9395 };
94- tabbedPane .setFont (new Font ("Segoe UI" , Font .PLAIN , 12 ));
95- initializeTabs ();
96- tabbedPanel .add (tabbedPane );
97- add (tabbedPanel , BorderLayout .CENTER );
9896
99- // Create a more polished button panel
100- JPanel buttonPanel = new JPanel (new FlowLayout (FlowLayout .RIGHT , 15 , 10 ));
97+ // Create and configure start button
10198 startButton = new JButton ("Start Obfuscation" );
10299 startButton .setFont (new Font ("Segoe UI" , Font .PLAIN , 12 ));
103100 startButton .setBackground (new Color (70 , 130 , 180 ));
104101 startButton .setForeground (Color .WHITE );
105102 startButton .setFocusPainted (false );
106- startButton .addActionListener (new AbstractAction () {
103+ startButton .setPreferredSize (new Dimension (160 , 30 ));
104+ startButton .addActionListener (e -> {
105+ if (e .getSource () == startButton ) {
106+ startObfuscation ();
107+ }
108+ });
109+
110+ int topSpace = 220 ;
111+ int bottomPadding = this .getPreferredSize ().height - 60 *3 ;
112+
113+ JPanel buttonPanel = new JPanel (new BorderLayout ());
114+ buttonPanel .add (startButton , BorderLayout .NORTH );
115+
116+ // Add copyright and website info
117+ JPanel copyrightPanel = new JPanel ();
118+ copyrightPanel .setLayout (new BoxLayout (copyrightPanel , BoxLayout .Y_AXIS ));
119+ copyrightPanel .setBorder (BorderFactory .createEmptyBorder (0 , 5 , 20 , 0 ));
120+ JLabel copyrightLabel = new JLabel ("© 2025 Skidfuscator" );
121+ copyrightLabel .setFont (new Font ("Segoe UI" , Font .BOLD , 10 ));
122+ copyrightLabel .setForeground (new Color (130 , 130 , 130 ));
123+ copyrightLabel .setAlignmentX (Component .CENTER_ALIGNMENT );
124+ copyrightLabel .setHorizontalAlignment (SwingConstants .CENTER );
125+ JLabel allRightsReservedText = new JLabel ("<html><div style='width:100%;text-align:justify'>All rights reserved. The use of this software is subject to the terms of the Skidfuscator License Agreement. Unauthorized reproduction or distribution of this software, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law.</div></html>" );
126+ allRightsReservedText .setFont (new Font ("Segoe UI" , Font .PLAIN , 6 ));
127+ allRightsReservedText .setForeground (new Color (130 , 130 , 130 ));
128+ allRightsReservedText .setAlignmentX (Component .CENTER_ALIGNMENT );
129+ allRightsReservedText .setHorizontalAlignment (SwingConstants .CENTER );
130+ allRightsReservedText .setBorder (BorderFactory .createEmptyBorder (10 , 5 , 10 , 5 ));
131+
132+ JSeparator separator = new JSeparator ();
133+ separator .setForeground (Color .DARK_GRAY );
134+ separator .setMaximumSize (new Dimension (Integer .MAX_VALUE , 1 ));
135+
136+ JLabel websiteLabel = new JLabel ("skidfuscator.dev" );
137+ websiteLabel .setFont (new Font ("Courier New" , Font .PLAIN , 10 ));
138+ websiteLabel .setForeground (new Color (70 , 130 , 180 ));
139+ websiteLabel .setCursor (new Cursor (Cursor .HAND_CURSOR ));
140+ websiteLabel .setAlignmentX (Component .CENTER_ALIGNMENT );
141+ websiteLabel .setHorizontalAlignment (SwingConstants .CENTER );
142+ websiteLabel .addMouseListener (new MouseAdapter () {
107143 @ Override
108- public void actionPerformed (ActionEvent e ) {
109- if (e .getSource () == startButton ) {
110- startObfuscation ();
144+ public void mouseClicked (MouseEvent e ) {
145+ try {
146+ Desktop .getDesktop ().browse (new URI ("https://skidfuscator.dev" ));
147+ } catch (Exception ex ) {
148+ ex .printStackTrace ();
111149 }
112150 }
113151 });
114- buttonPanel .add (startButton );
115- add (buttonPanel , BorderLayout .SOUTH );
152+ copyrightPanel .add (copyrightLabel );
153+ copyrightPanel .add (separator );
154+ copyrightPanel .add (allRightsReservedText );
155+ copyrightPanel .add (separator );
156+ copyrightPanel .add (websiteLabel );
116157
117- // Set keyboard mnemonics
118- setupKeyboardShortcuts ();
119-
120- // Final setup
121- pack ();
122- setLocationRelativeTo (null );
123- }
158+ buttonPanel .setBorder (BorderFactory .createEmptyBorder (10 , 5 , 20 , 0 ));
124159
125- private void initializeTabs () {
126160 // Initialize panels
127161 configPanel = new ConfigPanel ();
128162 transformerPanel = new TransformerPanel ();
129163 consolePanel = new ConsolePanel ();
130164
131- // Add Configuration tab
132- JPanel configTabPanel = createTabPanel ( configPanel , "Configuration" );
133- tabbedPane .addTab ("Configuration " , null , configTabPanel , "Basic configuration settings" );
134- tabbedPane .setMnemonicAt ( 0 , KeyEvent . VK_C );
165+ // Add tabs (without content)
166+ tabbedPane . addTab ( "Configuration" , null );
167+ tabbedPane .addTab ("Transformers " , null );
168+ tabbedPane .addTab ( "Console" , null );
135169
136- // Add Transformers tab
137- JPanel transformerTabPanel = createTabPanel (transformerPanel , "Transformers" );
138- tabbedPane .addTab ("Transformers" , null , transformerTabPanel , "Transformer settings and options" );
170+ // Set mnemonics
171+ tabbedPane .setMnemonicAt (0 , KeyEvent .VK_C );
139172 tabbedPane .setMnemonicAt (1 , KeyEvent .VK_T );
140-
141- // Add Console tab
142- JPanel consoleTabPanel = createTabPanel (consolePanel , "Console Output" );
143- tabbedPane .addTab ("Console" , null , consoleTabPanel , "View obfuscation progress and logs" );
144173 tabbedPane .setMnemonicAt (2 , KeyEvent .VK_O );
145174
146- // Set default selected tab
147- tabbedPane .setSelectedIndex (0 );
148- }
175+ // Add components to the left panel
176+ leftPanel .add (tabbedPane , BorderLayout .NORTH );
177+ leftPanel .add (buttonPanel , BorderLayout .CENTER );
178+ leftPanel .add (copyrightPanel , BorderLayout .SOUTH );
179+
180+ // Create a panel for the content area
181+ JPanel contentPanel = new JPanel (new BorderLayout ());
182+ contentPanel .setBorder (
183+ BorderFactory .createEmptyBorder (10 , 0 , 10 , 10 ));
184+ contentPanel .add (configPanel , BorderLayout .CENTER ); // Show config panel by default
185+
186+ // Add panels to the frame
187+ add (leftPanel , BorderLayout .WEST );
188+ add (contentPanel , BorderLayout .CENTER );
189+
190+ // Add a listener to update the content panel when tabs change
191+ tabbedPane .addChangeListener (e -> {
192+ contentPanel .removeAll ();
193+ switch (tabbedPane .getSelectedIndex ()) {
194+ case 0 :
195+ contentPanel .add (configPanel , BorderLayout .CENTER );
196+ break ;
197+ case 1 :
198+ contentPanel .add (transformerPanel , BorderLayout .CENTER );
199+ break ;
200+ case 2 :
201+ contentPanel .add (consolePanel , BorderLayout .CENTER );
202+ break ;
203+ }
204+ contentPanel .revalidate ();
205+ contentPanel .repaint ();
206+ });
149207
150- private JPanel createTabPanel (JComponent component , String title ) {
151- JPanel panel = new JPanel (new BorderLayout ());
152- panel .setBorder (BorderFactory .createCompoundBorder (
153- BorderFactory .createEmptyBorder (10 , 10 , 10 , 10 ),
154- BorderFactory .createTitledBorder (title )
155- ));
156- panel .add (component , BorderLayout .CENTER );
157- return panel ;
208+ // Final setup
209+ pack ();
210+ setLocationRelativeTo (null );
158211 }
159212
160213 private void setupKeyboardShortcuts () {
0 commit comments