Skip to content

Commit

Permalink
number
Browse files Browse the repository at this point in the history
  • Loading branch information
cubewhy committed Jan 13, 2024
1 parent 57ff14f commit 8d9a1e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/cubewhy/celestial/files/ConfigFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ConfigFile setValue(String key, char value) {
return this.save();
}

public ConfigFile setValue(String key, int value) {
public ConfigFile setValue(String key, Number value) {
this.config.addProperty(key, value);
return this.save();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ private void addUnclaimed(JPanel basePanel) {
spinner.setAutoscrolls(true);
JComponent editor = spinner.getEditor();
JFormattedTextField textField = ((JSpinner.DefaultEditor) editor).getTextField();
spinner.addChangeListener((e) -> {
JSpinner source = (JSpinner) e.getSource();
Number v = (Number) source.getValue();
config.setValue(key, v);
});
textField.setColumns(20);
panel.add(spinner);

Expand Down

0 comments on commit 8d9a1e6

Please sign in to comment.