• 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

Focus problem

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a build a gui application in swings....

The GUI has a toolbar with undo,redo,cut,copy,paste options.
The GUI also has a JInternalFrame with some graphic components say circle,rect. etc

I have also provided mnemonics to the GUI design...

Problem is, mnemonics are not working, when the focus is out of scope.

how to handle this problem?
need help regarding..

Note: JInternalFrame--->JScrollPane---Graph Components
 
Abhishek Reddy
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello its urgent, just give me some suggestions...
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello Ease Up, perhaps nobody has any suggestions at this time...
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> Problem is, mnemonics are not working, when the focus is out of scope.

do you mean when some other app (e.g. notepad) is the active window?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you try with keyboard accelerators.
Keyboard accelerators are a bit more universal then mnemonics and might solve the problem.
 
Abhishek Reddy
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the reply...

the application has two JInternalFrames...the undo operations will be done in one JInternal Frame say iframe1.

the other JInternalFrame say iframe2 is only for display purpose.

if the focus is on iframe2, the undo chages in iframe1 is not reflected...
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
because they're internalFrames, you may have to get a bit lower in the event chain then keyBindings

here's a couple of ways to do that (in this e.g. using a button with mnemonic).
new problem is when jif1 has the focus, both mnemonic and the added code
trigger the button's actionEvent - so you may have to remove the mnemonic

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> you may have to get a bit lower in the event chain then keyBindings

on second thoughts, keyBindings of the desktop works better
(doesn't also trigger the mnemonic)

 
Abhishek Reddy
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks alot...

it worked fine..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic