Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My JFrame pops up inside a regular windows window??

 
luc comeau
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

The way i was taught to do applications using the swing components was to make your class, then do everything insde the constructor, then just initialze a new instance of the gui class in your main.I think this is where im runing into my problem of my JFrame actually popping up inside a windows style window.

My class is like this



And this makes the Jframe pop up inside a regular windows window, its frigin retarded looking! haha i just never noticed in school, any idea how to just make my application a JFrame?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm, that's what it's supposed to do. It will exist in whatever native OS window exists for that platform, be it windows, KDE, GNome, etc. What were you expecting?
 
luc comeau
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Gregg,

Well, what i expected was the JFrames that i see on all the examples iv looked at on the web, i want it to have the java look and feel not the windows look and feel.But i dont know why its displaying a nice looking frame inside a crappy windows frame, it only happens when i put this line of code in my main method


when that is added, instead of having just the crappy windows frame and then my application inside(it has a tabbed pane on it) when i add that it makes a new frame inside that window that looks how i want the entire thing to look?Its like an internal frame, it has its own functionailty like minimize and close etc, so i figure there must be some way to just get that frame alone without the windows ones surrounding it, and i dont think im crazy cause i see example everywhere, iv tryed changing the L&F without sucess it just seems to ignore it?
The frame i get inside the windows XP window looks verbatim to the first one on this pageJFrame
I have an inclination that if i were to write a small GUI inside a main() is would look like the frame on that url, not sure though im new with all this relativly.Anyways thats what i was expecting, and im quite sure its possible to acheive somehow, just not sure whats gogin on.
thanks
-luc
 
luc comeau
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also i've tryed doing this
JFrame.setDefaultLookAndFeelDecorated(true);

but i really have no idea where to put that so it works, iv dl'd a few examples and that seems to be what makes it have the decorated window dressings, but i dont know how to make it work with the way i have it set up.
 
luc comeau
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok figured it out, had to look at more examples, apears that i cant extend JFrame at the very begining i must extend Jpanel, and then i made a method createAndShowGUI() in wich i created a jframe and added the JPanel to it that contained everything...strange anyways its all good now, thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic