| Author |
Replacinf Java cup icon of JFrame and changing default folder look in JTree
|
Ajit Kanada
Ranch Hand
Joined: Jan 23, 2001
Posts: 95
|
|
Hi I m doing a GUI application.I want to replace the JAVA cup on the JFrame with my image.How can this be done? Also i have a JTree.I want to change default look of Java folders to Windows look .Is it possible?? Can somebody help... Thanx in advance Ajit
|
Thankx
Ajit
|
 |
Chhaya Dhanani
Ranch Hand
Joined: Apr 11, 2001
Posts: 70
|
|
Hi ajit, if u carefully go thru' the methods inherited by various classes in the JFRame api, u will notice that there is method setImageIcon(Image i) which JFrame inherits from Frame u can use this in the following manner: //import statements public class Test extends JFrame { Toolkit kit; IamgeIcon i; public Test()// constructor { kit=Toolkit.getDefaultToolkit(); i=kit.createImage("YOUR IMAGE FILE PATH GOES HERE"); setImageIcon(i); }//end of constructor }//end of class that should solve ur problem Chhaya
|
 |
Chhaya Dhanani
Ranch Hand
Joined: Apr 11, 2001
Posts: 70
|
|
Hi once again ajit, for the windows look and feel just insert the following code in your constructor: try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception exc){ } thats it happy coding  Chhaya
|
 |
Ajit Kanada
Ranch Hand
Joined: Jan 23, 2001
Posts: 95
|
|
Thanx chaya ...its perfectly fine thanx again Ajit
|
 |
Rahul Goel
Greenhorn
Joined: Jul 05, 2002
Posts: 1
|
|
hai everyBody, My Name is Rahul Goel I have a Problem in the Java in preparing the Online Testing Software. Plz tell me ho can I Hide the Title Bar of the JFrame and please send me the whole code of Changing the Icon of JFrame and adding a JMenuBar on the JPanel
|
rahul
|
 |
 |
|
|
subject: Replacinf Java cup icon of JFrame and changing default folder look in JTree
|
|
|