2424
2525package com .synapticloop .panl .editor ;
2626
27+ import com .formdev .flatlaf .FlatLaf ;
2728import com .formdev .flatlaf .FlatLightLaf ;
2829
2930import javax .swing .*;
@@ -40,14 +41,44 @@ public void show() {
4041
4142 //1. Create the frame.
4243 JFrame frame = new JFrame ("Panl Configuration Editor" );
43- JLabel emptyLabel = new JLabel ( "" );
44- emptyLabel . setPreferredSize (new Dimension (400 , 600 ));
44+ frame . setPreferredSize ( new Dimension ( 400 , 600 ) );
45+ frame . setMinimumSize (new Dimension (400 , 600 ));
4546 frame .setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
4647
47- frame .getContentPane ().add (emptyLabel , BorderLayout .CENTER );
48+ // JButton button = new JButton("Select panl.properties file");
49+ // button.setPreferredSize(new Dimension(200, 40));
50+ //
51+ // frame.setContentPane(button);
52+ frame .getContentPane ().add (generateSelectFile (), BorderLayout .CENTER );
53+ JLabel jLabel = new JLabel ("No panl.properties file found" );
54+ jLabel .setHorizontalAlignment (SwingConstants .CENTER );
55+ jLabel .putClientProperty ( "FlatLaf.styleClass" , "h1" );
56+
57+ frame .getContentPane ().add (jLabel , BorderLayout .NORTH );
4858
4959 frame .pack ();
5060
5161 frame .setVisible (true );
5262 }
63+
64+ private JPanel generateSelectFile () {
65+ JPanel panel = new JPanel (new GridBagLayout ());
66+ GridBagConstraints gbc = new GridBagConstraints ();
67+ gbc .gridwidth = 3 ;
68+ gbc .gridheight = 10 ;
69+
70+ gbc .gridx = 0 ;
71+ gbc .gridy = 1 ;
72+
73+
74+
75+ JButton button = new JButton ("Select panl.properties file" );
76+ button .setMaximumSize (new Dimension (200 , 40 ));
77+ button .setPreferredSize (new Dimension (200 , 40 ));
78+ button .setMinimumSize (new Dimension (200 , 40 ));
79+ gbc .gridx = 1 ;
80+ gbc .gridy = 5 ;
81+ panel .add (button , gbc );
82+ return (panel );
83+ }
5384}
0 commit comments