java - How to change the image by click keyboard arrows? -


I have created a project in java. Now in this particular module, I am showing the user, so I'm showing them stock inventory.

To do this now.

As you will see in the screen shot [I have a screenshot so that you can understand well).
To show the picture, I have created a table and I have put the label in it and then I am setting the icon on the label.

Now click on any image as user, then I will place that image on big label
But this works perfectly on mouse clicks, but the customer wants that, if the user navigates through the arrow arrow, then it should be equally.

Meaning: If the user navigated by the main board, then that table [the user should know which is currently hidden] should be considered and as soon as the user key board Aero Events navigated and Then click on that image

P> There are two steps needed to be done.

First of all, the user should know which image is selected. Unfortunately I can not help you with it, because I do not know how you are showing that grid. From the UI point, I suggest you exploit that white border in each cell - change it to black, blue or in color that you want to indicate that this is the selected cell, you seem to be using a JTable In that case, you can (possibly expand) and call its setBackground () method.

Then you need to listen to the keyboard input; this part should not be too bad; Write and add it to JTable only for each major event, see that the key code matches the arrow keys; If so, then move your cursor around accordingly. Do not forget to see the edges of jetties.


Comments