• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Remove the dotted line around Jslider

 
Ranch Hand
Posts: 111
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

As strange behavior that I observe when I use JSlider on Windows System.
Could you give the tric to remove the dotted line around the slider (see picture below) ?




Thanks

Christian
Sans-titre.png
[Thumbnail for Sans-titre.png]
Dotted Line
 
Christian Klugesherz
Ranch Hand
Posts: 111
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I got it ;-)

 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a very good solution.

The user should be able to use the GUI with the mouse or the keyboard.

By making the component non-focusable the user will not be able to tab to the slider and change its values.

The point of the dotted border is to show that the component has focus so it can accept KeyEvents.

Don't design a GUI that restricts how the user can use the functionality on a component.
 
Christian Klugesherz
Ranch Hand
Posts: 111
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevertheless by set focus to false, it is working perfectly

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It only works "perfectly" given the unusual requirement to interfere with the standard GUI conventions for Windows systems.
 
Rob Camick
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No it doesn't work perfectly.

You can no longer use the right/left arrow keys to adjust the slider.

The proper design of a GUI means the user (not you) can choose to use either the keyboard or the mouse.

 
Christian Klugesherz
Ranch Hand
Posts: 111
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Understood.

But what is strange, is that by default, without the windows environment, I don't have this dotted line :-(

For example by removing



Is there a way to remove the dotted line with window operation system

Thanks


 
Rob Camick
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is there a way to remove the dotted line with window operation system



I have no idea how to do this. The Windows LAF is contained in the WindowsSliderUI class. So you would have to look at that class to see if there is any way to customize the behaviour. However, this is not something I would recommend.

Again, this is the way the Windows LAF was designed to work.

In this case the dotted line is used to show the user which component has focus. This is the same for a JButton or JCheckBox. When a text component has focus you see a blinking caret.

Try other Windows applications and you will see this behaviour.

For example in IE you can go to Tools - Intenet Options - Security. Then tab to the "Security Level" slider. You will see the dotted line.

Windows users expect to see this dotted line.

 
Christian Klugesherz
Ranch Hand
Posts: 111
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I understood.

Many thanks for the clarifications

It all makes sense

Christian
 
reply
    Bookmark Topic Watch Topic
  • New Topic