Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextField is not focused in my LAF during TAB pressing

 
camron camronx
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have created my own LAF - see code below - and I do not know, why JTextField component is not focused while I am pressing TAB key (java 1.7.0_07b, Win7). Please, write me, what I have missed to implement in my LAF. Thank you.

Camron

Example.java



MyLookAndFeel.java

 
Jesse Weiman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked if the tab-focus feature works when you use the default LAF?
 
camron camronx
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesse Weiman wrote:Have you checked if the tab-focus feature works when you use the default LAF?


Yes, I tried it. tab-focus feature works works well under windwos LAF and default JAVA LAF. Just change UIManager.setLookAndFeel("MyLookAndFeel"); in my Example.java to:



I
 
Tony Docherty
Bartender
Posts: 2952
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not an area I've ever done anything on but my understanding was that the LookAndFeel class had to provide a UIDelegate class for every supported component. These UIDelegates can be sub classes of the basic UIDelagte classes but I wasn't aware you could just return the basic UIDelegates, that would be effectively the same as setting the overall Look and Feel to Basic which isn't an option I'm aware of.

Have you tried extending the MetalLookAndFeel class to see if that gives you the tabbing behaviour you want.

BTW why are you writing your own look and feel?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic