View Single Post
  #13 (permalink)  
Old 06-29-2009, 10:43 AM
Gajesh Tripathi Gajesh Tripathi is offline
Member
 
Join Date: Aug 2007
Posts: 38
Rep Power: 0
Gajesh Tripathi is on a distinguished road
Smile [SOLVED] Desktop Icons Application
Originally Posted by Darryl.Burke View Post
Use a GridLayout with JButtons that have setContentAreaFilled(false) and setBorderPainted(false). You may also want to setRolloverEnabled(false).

Set an icon and text to each button, and setHorizontalTextPosition(SwingConstants.CENTER) / setVerticalTextPosition(SwingConstants.TOP)
Dear Brova, My problem is solved after using your concept with JButton....Thank you very much.

I made a sample program that fulfill my requirement (as per Brova's suggession) and it will be helpful for others that want to create simillar desktop icon application. Please note that I did not register any action listener for buttons. Instead, I used key listener on button: Left,Right,Up,Down key to transfer focus & Enter key to call double click mouse event for that button. {.jar file is also attached to execute this sample program directly}

Quote:
but you can edit them in CarouselFinal.java class
RapidShare: Easy Filehosting
Dear Serjant, Your program is very impresive. Please provide me .zip link for CarouselFinal.java to open with Windows
Attached Files:
File Type: zip UtilityPrograms.zip (36.2 KB, 4 views)
File Type: txt TestDesktopApp.txt (11.3 KB, 0 views)

Last edited by Gajesh Tripathi; 06-29-2009 at 12:01 PM. Reason: Forgot to attach source file
Reply With Quote