aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTextField is not focused in my LAF during TAB pressing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextField is not focused in my LAF during TAB pressing" Watch "JTextField is not focused in my LAF during TAB pressing" New topic
Author

JTextField is not focused in my LAF during TAB pressing

camron camronx
Greenhorn

Joined: Oct 12, 2012
Posts: 2
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

Joined: Oct 10, 2012
Posts: 12
Have you checked if the tab-focus feature works when you use the default LAF?
camron camronx
Greenhorn

Joined: Oct 12, 2012
Posts: 2
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

Joined: Aug 07, 2007
Posts: 2406
    
  50
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTextField is not focused in my LAF during TAB pressing