Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New kind of a vlue field #162

Open
peteihis opened this issue Feb 28, 2020 · 3 comments
Open

New kind of a vlue field #162

peteihis opened this issue Feb 28, 2020 · 3 comments
Labels

Comments

@peteihis
Copy link
Contributor

peteihis commented Feb 28, 2020

Hi.

Working on #161 I began to miss a new kind of a value field:

  • It should have lower and upper limit values, that can be set by constructor or by method
  • It should have include/exclude option for the limit values (meaning > or => and < or =<).
  • It should have increment arrows to add reduce the value.
  • The increment sholud be set by constructor or method
  • It might have a choice whether the increment snaps to multiplies of the increment or if it just adds/reduces the current value by the increment.
  • Things like NONNEGATIVE would be replaced by the limit values but the INTEGER / DOUBLE ... options should be available

A constructor could look like something like this.

public LimitedValueField(int value, int type, int lowerLimit, boolean includeLL, int upperLimit, boolean includeUL, boolean showArrows)

And simply a limit value 'null' would mean that the limit is not set and if the upper limit is lower than the lower limit, it could at simplest be just ignored.

@makiam
Copy link
Contributor

makiam commented Feb 28, 2020

Looks very similar to standard JSpinner with set it's limitations via JSpinnerNumber model...

@peteihis
Copy link
Contributor Author

And I see the there is a BSpinner too with a few options and it can take a SpinnerModel as well.... Got to study those some time a bit.

On the other hand I struggled some time ago with something similar trying to have a ComboBox display an icon and a text but, what ever it promised, never worked as I would have expected, so a promse is still just a promise with these toys. Makin one the way the ValueField is made does not look like an overwhelmingly huge a job.

@Sailsman63
Copy link
Member

Do keep in mind that the BComponent variants have a limited API. However, getComponent() will allow you to use the full API of the underlying JComponent when you need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants