Skip to content

Commit

Permalink
Fixed display
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Jan 13, 2022
1 parent f54b481 commit 12d06ee
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ public JavaPanel() {
SingleFlatFileProvider provider = new SingleFlatFileProvider(Paths.get(Platform.getInstallDir().toString(), "args.txt").toFile());
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.weighty = 0;
c.weightx = 1;
c.gridwidth = GridBagConstraints.REMAINDER;
{
JLabel label = new JLabel("Java Command Line Options:");
add(label, c);
if (provider.exists()) {
JTextField textbox = new JTextField();
label.setLabelFor(textbox);
textbox.setPreferredSize(new Dimension(textbox.getMaximumSize().width, textbox.getPreferredSize().height));
// textbox.setText("Foo");
textbox.setText(provider.read());
textbox.getDocument().addDocumentListener(new DocumentListener() {
// TODO: make a thing for these
Expand All @@ -45,8 +47,10 @@ public void changedUpdate(DocumentEvent e) {
}
});
c.gridy++;
c.gridwidth = 1;
add(textbox, c);
c.gridy++;
c.gridwidth = GridBagConstraints.REMAINDER;
JLabel label2 = new JLabel("WARNING: This can break things if you set bad values. These are stored in args.txt in your install dir.");
add(label2, c);
}
Expand Down

0 comments on commit 12d06ee

Please sign in to comment.