5
5
import com .runeprofile .RuneProfilePlugin ;
6
6
import lombok .extern .slf4j .Slf4j ;
7
7
import net .runelite .client .ui .ColorScheme ;
8
- import net .runelite .client .ui .DynamicGridLayout ;
9
8
import net .runelite .client .ui .FontManager ;
10
9
import org .apache .commons .lang3 .StringUtils ;
11
10
12
11
import javax .swing .*;
12
+ import javax .swing .border .Border ;
13
13
import javax .swing .border .EmptyBorder ;
14
14
import java .awt .*;
15
15
import java .awt .datatransfer .Clipboard ;
@@ -22,7 +22,11 @@ public class PrivateProfilePanel extends JPanel {
22
22
private final JLabel urlLabel = new JLabel ();
23
23
24
24
public PrivateProfilePanel (RuneProfilePlugin runeProfilePlugin ) {
25
- setLayout (new DynamicGridLayout (0 , 1 , 0 , 4 ));
25
+ setLayout (new BorderLayout ());
26
+
27
+ JPanel wrapper = new JPanel (new GridLayout (0 , 1 , 0 , 4 ));
28
+
29
+ Border buttonBorder = new EmptyBorder (8 , 16 , 8 , 16 );
26
30
27
31
String storedUrl = RuneProfilePlugin .getConfigManager ().getRSProfileConfiguration (RuneProfileConfig .CONFIG_GROUP , RuneProfileConfig .GENERATED_PATH );
28
32
privateUrl .set (storedUrl == null ? "None" : storedUrl );
@@ -31,7 +35,7 @@ public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
31
35
JLabel titleLabel = new JLabel ("Private Profile URL" );
32
36
titleLabel .setFont (FontManager .getRunescapeBoldFont ());
33
37
titleLabel .setForeground (Color .WHITE );
34
- add (titleLabel );
38
+ wrapper . add (titleLabel );
35
39
36
40
String isPrivateString = RuneProfilePlugin .getConfigManager ().getRSProfileConfiguration (RuneProfileConfig .CONFIG_GROUP , RuneProfileConfig .IS_PRIVATE );
37
41
System .out .println ("isPrivateString: " + isPrivateString );
@@ -61,7 +65,7 @@ public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
61
65
SwingUtilities .invokeLater (() -> privateCheckbox .setEnabled (true ));
62
66
}).start ();
63
67
});
64
- add (privateCheckbox );
68
+ wrapper . add (privateCheckbox );
65
69
66
70
JPanel urlContainer = new JPanel ();
67
71
urlContainer .setLayout (new BorderLayout ());
@@ -70,15 +74,16 @@ public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
70
74
71
75
urlLabel .setFont (new Font ("Courier New" , Font .PLAIN , 11 ));
72
76
urlContainer .add (urlLabel );
73
- add (urlContainer );
77
+ wrapper . add (urlContainer );
74
78
75
79
JButton copyButton = new JButton ("Copy" );
76
80
copyButton .addActionListener (e -> {
77
81
StringSelection stringSelection = new StringSelection (privateUrl .get ());
78
82
Clipboard clipboard = Toolkit .getDefaultToolkit ().getSystemClipboard ();
79
83
clipboard .setContents (stringSelection , null );
80
84
});
81
- add (copyButton );
85
+ copyButton .setBorder (buttonBorder );
86
+ wrapper .add (copyButton );
82
87
83
88
JButton newButton = new JButton ("Generate New URL" );
84
89
newButton .addActionListener ((event ) -> {
@@ -95,7 +100,10 @@ public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
95
100
newButton .setEnabled (true );
96
101
}).start ();
97
102
});
98
- add (newButton );
103
+ newButton .setBorder (buttonBorder );
104
+ wrapper .add (newButton );
105
+
106
+ add (wrapper , BorderLayout .NORTH );
99
107
}
100
108
101
109
private void setNewURL (String path ) {
0 commit comments