• 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
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Programming With Keystrokes  RSS feed

 
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have overridden the default ENTER keystroke for a JTable to allow for a customized function when ENTER is pressed.
I also want the UP and DOWN arrow keys to allow the user to move through each table cell vertically. This works by default, but no longer works after the first time ENTER
is pressed, even though I have used requestFocus on JTable after the dismissal of custom JDialog that appears upon pressing ENTER. Do I also have to reprogram the UP and DOWN keystrokes to keep vertical movement in the JTable?

 
Rancher
Posts: 2958
20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine for me when I display a JOptionPane in the ActionListener. Don't know why your custom dialog would be any difference.

 
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't the problem caused by the table losing the focus after performing the ENTER key action? Just guessing.
 
Rob Camick
Rancher
Posts: 2958
20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Martin Vajsar wrote:Isn't the problem caused by the table losing the focus after performing the ENTER key action? Just guessing.



The original question states that the poster has tried adding a request focus after the dialog is dismissed.

Also, why does the code work for me even though I don't request focus?

Who knows? That is why we need a SSCCE, otherwise all we can do is guess.
 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a JXLayer<JComponent>layer with Blur effect over the JInternalFrame in which I have the JTable. When the custom dialog is launched the Layer and blur effect kick in which has the effect of making the contents of the undecorated custom JDialog appear sharper. It could have something to do with this, so I will check this.
 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as I suspected, it has to do with the JXLayer with Blur effect over the JInternalFrame in which I have placed the JTable.
 
Rob Camick
Rancher
Posts: 2958
20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Just as I suspected, it has to do with the JXLayer



Just as I suspected, your original question did not contain enough information for us to solve your problem.

I have answered several of your questions in the past and several times I have asked for a SSCCE with your original question.

Yet again you did not provide a SSCCE so you have again wasted the time of everyone who has taken the time in an attempt to answer this question. The whole point of a SSCCE is for you to narrow down the problem so we don't waste time guessing!

I for one will no longer be answering your questions unless a proper SSCCE is posted, I've wasted too much time guessing and asking for a SSCCE in the past.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!