AWFUL Jframe decoration.. yuk !
Hi all ..
I have a program that has a JFrame and an jInternalFrame.. the decorations of both are supposed to be the same.. but look .
http://members.lycos.co.uk/tarekeldeeb/decorations.JPG
i dont know why ..?
When i open the demos of java (by webstart) .. they have outer decorations at their JFrames ..good ones....but unfortunately .. not my program ..
can any1 explain why this could happen ?
Thanks in advnce..
yours,
Tarek
I don't understand what you are asking.Run the demo from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/internalframe.html]How to Use Internal Frames[/url]. The decorations look the same to me.
I can use jInternal frame..
didnt you see the picture i linked ?
the qustion is: decoration of jInternalFrame is good.. while the decoration of the outer jFrame is not good ... why ?
also : when I open the demos.. the outer Jframe has good decorations.. so there is no problem with the OS or the JRE .. something is wrong in my code or settings... what could it be ?
Thanks in advance .. and waiting for replies
> didnt you see the picture i linked ?
the picture you posted means nothing to me. I have no idea what code was used to generate the GUI.
> the qustion is: decoration of jInternalFrame is good.. while the decoration of the outer jFrame is not good ... why ?
I have no idea, because I have no idea what your code looks like.
> something is wrong in my code or settings... what could it be ?
Do you not understand the concept of running the Demo programs and looking at the code they use and compare it with your code to see what the difference is? Thats why I pointed you to the tutorial. Learn by example.
Check your code and see if you are executing this method, if so remove the call to it: http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JFrame.html#setDefaultLookAndFeelDecorated(boolean)
Dear Mr. Camickr and MJParme ..
this is the code i use to initialize the JFrame..
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
JFrame.setDefaultLookAndFeelDecorated(true);
Mo7asbaJFrame mjf = new Mo7asbaJFrame();
mjf.setSize(603,425);
mjf.setVisible(true);
}
});
}
my class " Mo7asbaJFrame" extends JFrame.. and I added components to it as usual ..
can u help me now ?
Did you read my post?Remove the call to setDefaultLookAndFeelDecorated.
Yes I have read your post ..but if I try to remove this method.. the native style (from windows) will be put as a decoration instead of the java lookandfeel .. i dont want this..another point.. please be more patient .. Thanks a lot for your help !
> another point.. please be more patient ..
Did you read the tutorial I gave you the link to?
Did you execute the source code from that tutorial?
Do the JFrame and JInternalFrame look the same?
If you answered "YES" to all of the above, then your code is different that the tutorial code. What part about compare your code with the tutorial code do you not understand? We can not guess what you are doing differently. We are not mind readers.
Thanks a lot for all the effort ..
yes ,, i tried the demo.. looked good..
I FINALLY KNEW THE PROBLEM ..
i tried alo this demo :
C:\Program Files\Java\jdk1.5.0_06\demo\jfc\SwingSet2
(installed with JDK)
The problem is: when the JFrame(or the jInternalFrame) is NOT resizable it gives this bad looking decoration.. when it is resizable .. it looks good..
again, Thanks a lot for all the time I took from you
Yours,
Tarek
> when the JFrame(or the jInternalFrame) is NOT resizable it gives this bad looking decorationMakes no difference when I test it. They still look fine to me.I'm using JDK1.4.2. Maybe its a 1.5 problem.