Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GUI Swing related

 
Geetgovind Mav
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,
I'm trying to use this statement ----- JFrame.setDefaultLookAndFeelDecorated(true) which is present in JDK1.4. I've Java Tiger & beyond but still this statement does'nt compile. Can anyone help me out as to why this statement is'nt compiling???
 
Campbell Ritchie
Sheriff
Pie
Posts: 49447
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

What compiler error are you getting?
 
Geetgovind Mav
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mam,
I am getting Compiler Error : "cannot resolve symbol"
& when I type 'java -version' on command prompt, it says java version "1.6.0_07".
Thanking you in anticipation...

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which symbol -- JFrame or setDefaultLookAndFeelDecorated? Are you sure everything is spelled correctly?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49447
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what do you get if you type "javac -version"?
 
Olivier Legat
Ranch Hand
Posts: 176
Chrome Mac Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do what Ritchie is suggesting. type "javac -version". If you're compiler is up to date then post your code, otherwise we won't be able to help you. Remember that the more information you give the better chance of finding the problem
 
Geetgovind Mav
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your suggestions.
I typed everything correctly. Also, I typed javac -version, but there is an error message javac: invalid flag: -version
What might be the reason???
Some background info....I've run it on Eclipse using JDK 5, & it runs fine in it. But running on Command Prompt is problematic via the Java Compiler.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Geetgovind Mav wrote:Thanks for your suggestions.
Also, I typed javac -version, but there is an error message javac: invalid flag: -version
What might be the reason???


javac didn't have a "-version" switch until JDK 1.5, so the compiler you're using is older than you think. Type this instead and it will tell you the real version:

javac -J-version

(That's javac space dash J dash version).
 
Geetgovind Mav
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ernest!
It seems I've an older compiler JDK 1.3.0_05 . But I've JDK 1.5.0_13 set in my environment variables path.
But still all this while I was compiling via JDK 1.3.0_05???
 
Olivier Legat
Ranch Hand
Posts: 176
Chrome Mac Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange indeed. How did you install Java on your computer? Directly from the Java Sun website or copy/pasting it from a friend? I remember my brother once had a similar problem.
 
Geetgovind Mav
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had copy/pasted it from a friend. I went to the following site...http://www.java.com/en/download/help/testvm.xml where we get to know our version directly. Its findings were "You have an older version of JRE....Your Java configuration is...Version : Java 6 Update 7"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic