This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Focus problem

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
hello its urgent, just give me some suggestions...
 
Sheriff
Posts: 21803
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
thanks alot...

it worked fine..
 
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!