Coder Social home page Coder Social logo

Comments (5)

DevCharly avatar DevCharly commented on July 28, 2024 3

Following lines cause the problem:

Dimension spinnerSize = spinner.getSize();
spinnerSize.width = 50;
spinner.setPreferredSize(spinnerSize);

spinner.getSize() always returns 0, 0 because the spinner was just created and is not yet layouted.
So the preferred height of the spinner becomes 0, which FlatLaf does not like.
Probably a bug in FlatLaf. Will investigate...

Anyway seems that the intention of the above code is to limit the preferred width of the spinner.
Replacing spinner.getSize() with spinner.getPreferredSize() should fix the issue.

from scijava-ui-swing.

imagejan avatar imagejan commented on July 28, 2024 1

Thanks for the suggestion, @DevCharly. I can confirm this fixes the issue, and opened #78.

from scijava-ui-swing.

imagesc-bot avatar imagesc-bot commented on July 28, 2024

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/missing-spinner-buttons-with-flatlaf-look-and-feel/72185/2

from scijava-ui-swing.

tferr avatar tferr commented on July 28, 2024

FYI, I actually don't think (I could be, of course, wrong - I did not test any other L&F) limiting the preferred width of the spinner is needed. Things seem to work fine if one leaves it to defaults. Maybe this is just some historic code that has been carried over!? On #79, I have a couple of proposals on things that I found when looking into this.

from scijava-ui-swing.

tferr avatar tferr commented on July 28, 2024

FYI, I actually don't think (I could be, of course, wrong - I did not test any other L&F) limiting the preferred width of the spinner is needed. Things seem to work fine if one leaves it to defaults

I was wrong of course. The rationale for this is explained here: #79 (comment)

from scijava-ui-swing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.