1

Using IntelliJ IDEA GUI Editor, I want to achieve something like this:

final JSpinner spinner = new JSpinner();
spinner.setModel(new SpinnerNumberModel(25, 1, Integer.MAX_VALUE, 1));

Still, the list of properties doesn't show anything even closely resembling what I'm looking for, the only JSpinner bean property exposed being editor:

enter image description here

The only work around I've figured out is using a custom creation code.

I understand Swing has gone out of fashion for quite some time already, but I can't believe UI designer of the leading Java IDE is so inferior feature-wise compared to Eclipse WindowBuilder or NetBeans Matisse.

Bass
  • 4,977
  • 2
  • 36
  • 82
  • UI designer was never a priority for IntelliJ IDEA, it's more focused on the code editing and inspections. You may consider JFormDesigner plug-in if you do a lot of Swing. – CrazyCoder Oct 10 '18 at 19:33
  • @CrazyCoder Thanks, already figured that out. To be more precise, built-in GUI editor in IDEA is merely a joke. JFormDesigner is good indeed, but free alternatives (WindowBuilder/Matisse) are more than enough for my needs. – Bass Oct 10 '18 at 21:40

1 Answers1

0

To do this in IntelliJ, go to the Spring form designer and select the JSpinner and tick the box called Custom Create. Then you can use code such as below:

private void createUIComponents()
{
    SpinnerNumberModel sm = new SpinnerNumberModel(10, 1, 99999, 1);
    myJSpinner = new JSpinner(sm);
}

in the Form.form file. Here is my code which I adapted for my purposes from here

Joe Arnold
  • 43
  • 5