
06-26-2009, 06:20 AM
|
|
Member
|
|
Join Date: Aug 2007
Posts: 38
Rep Power: 0
|
|
Desktop Icons Applications
I have some utilities programs (.jar files that are made in java) for personnel department...Presently I provide the icons of .jar files to the user. Now, I want to club all classes within these .jar files into one single java program.
But I do not want to use Menu Bar OR Tool Bar. Instead, I want to use a desktop screen that contains icons for executing my programs by double click and one status bar that will show Information about my program
How can do such kind of desktop application in JAVA?
JDesktopPane is used for desktop application but I want to put icon within it.
You may understand my exact requirement by attached image.
I also provide you link of program:-
Share your files quickly, secure and easy (simillar program, i want to create in JAVA)
please give me some idea...
|
|

06-26-2009, 07:21 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
|
|
|
Use a JFrame with undecorated false. Once you set it to false, you cannot see any title bar on the top. Even in default you can't see menu bars in JFrame. Set the size dynamically to same as the desktop you want to place on.
|
|

06-26-2009, 10:35 AM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Ukraine,Zaporozhye
Posts: 483
Rep Power: 2
|
|
|
You can also make a transparent JPanel,drawing on the JPanel an image area which is at the back of the undecorated JFrame, to add the WindowListener to the JFrame, each time when you move the JFrame update this image, such way you will get a transparent window, I did much desktop widgets in this way
|
|

06-26-2009, 04:12 PM
|
|
Member
|
|
Join Date: Aug 2007
Posts: 38
Rep Power: 0
|
|
|
Thanks for suggessions.
I want to put images/icons with caption into Desktop Pane
Drawing the image in panel is very tough process. Is there any eaisest way as like we can see in VB language where image control is found to place directly into form.
|
|

06-26-2009, 06:45 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
|
|
|
The way serjant explain is really nice.
On the other way, which I explain you can use labels easily on the frame, and add images to those labels. That's the most easiest way I can see.
|
|

06-26-2009, 06:45 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
|
|
|
The way serjant explain is really nice.
On the other way, which I explain you can use labels easily on the frame, and add images to those labels. That's the most easiest way I can see.
|
|

06-26-2009, 10:58 PM
|
 |
Senior Member
|
|
Join Date: Sep 2008
Location: Madgaon, Goa, India
Posts: 662
Rep Power: 2
|
|
|
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)
db
|
|

06-27-2009, 12:43 PM
|
|
Member
|
|
Join Date: Aug 2007
Posts: 38
Rep Power: 0
|
|
JLabel can not be slected
Originally Posted by Eranga
|
The way serjant explain is really nice.
On the other way, which I explain you can use labels easily on the frame, and add images to those labels. That's the most easiest way I can see.
|
I have already tried it but Two problem with Label is:-
1. We can not select JLable
2. Text/Caption is not appearing at the bottom of Image Label however text position property is set.
|
Quote:
|
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)
|
Thanks Burke, I will try it; I hope JButton is best to solve my problem and your idea will work.
|
|

06-27-2009, 06:53 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
|
|
Originally Posted by Gajesh Tripathi
|
I have already tried it but Two problem with Label is:-
1. We can not select JLable
|
You mean that you cannot work on with the click event on JLabel. Actually you can do that, simply add mouse listener to the label and override corresponding methods. If you still confused let me know. I'll show you a simple example.
|
|

06-28-2009, 03:23 AM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Ukraine,Zaporozhye
Posts: 483
Rep Power: 2
|
|
|
A year ago I made some Carousel widget(transparent) where you can add launch applications, I will attach it here tomorrow, you can use it free it
|
|

06-28-2009, 08:53 AM
|
|
Member
|
|
Join Date: Aug 2007
Posts: 38
Rep Power: 0
|
|
Originally Posted by Eranga
|
|
You mean that you cannot work on with the click event on JLabel. Actually you can do that, simply add mouse listener to the label and override corresponding methods. If you still confused let me know. I'll show you a simple example.
|
Sir, I know the uses of mouse listener with JLabel...my meant that when we click on image/icon then it should be look like selected which is not possible with JLabel...Please download the .exe file from CALCULATIONS.exe and then execute it to better understand my problem....Thanks
Originally Posted by serjant
|
|
A year ago I made some Carousel widget(transparent) where you can add launch applications, I will attach it here tomorrow, you can use it free it
|
I am waiting serjant...
Last edited by Gajesh Tripathi; 06-28-2009 at 09:36 AM.
Reason: Wrong Link was provided
|
|

06-28-2009, 11:29 AM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Ukraine,Zaporozhye
Posts: 483
Rep Power: 2
|
|
Here is the jar file:
Carousel.jar
The launchers will not launch the programs, because they are initiated for Linux, but you can edit them in CarouselFinal.java class :
http://rapidshare.com/files/24950544...ck.tar.gz.html
Open the project in Eclipse, Open CarouselFinal class, String[] commands array is the array where you insert the launch command for the application,
carousel.add command adds image and the name of the application. If there are any questions, contact me. I think this application will help you
Here is the source:
Last edited by serjant; 06-28-2009 at 11:31 AM.
|
|

06-29-2009, 10:43 AM
|
|
Member
|
|
Join Date: Aug 2007
Posts: 38
Rep Power: 0
|
|
[SOLVED] Desktop Icons Application
Originally Posted by Darryl.Burke
|
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}
Dear Serjant, Your program is very impresive. Please provide me .zip link for CarouselFinal.java to open with Windows
Last edited by Gajesh Tripathi; 06-29-2009 at 12:01 PM.
Reason: Forgot to attach source file
|
|

07-01-2009, 10:40 AM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Ukraine,Zaporozhye
Posts: 483
Rep Power: 2
|
|
|
Quote:
|
|
Dear Serjant, Your program is very impresive. Please provide me .zip link for CarouselFinal.java to open with Windows
|
There is nothing to do, open CarouselFinal .java from the archive i gave you, and edit windows command in the array: String[] commands
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 05:53 PM.
|
|