• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

programe keeps opening minimilized

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why does my program start minimalized? I have changed jframes preferred, minimum, and maximum but it still happens?
 
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have anything in your JFrame?

Some code illustrating the problem would be nice.
 
mitchell cooper
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Les Morgan
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is one of several posts you have done today on, I believe, code. You need to go through the tutorials and figure out how to code a simple GUI.

mitchell cooper wrote:



You really need to read the tutorials on the fundamentals of GUI development, the one on naming would do wonders for you too.
 
Les Morgan
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is just a basic little JFrame app to get you started:


Here's a link to all the Oracle tutorials: http://docs.oracle.com/javase/tutorial/reallybigindex.html
 
Marshal
Posts: 79240
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

mitchell cooper wrote:

It is probably a good discipline to create GUIs without extending any display classes, except possibly to override paintComponent and a few other methods mentioned in this thread. It is probably another good discipline not to let NetBeans confuse your code by adding all sorts of things to it while you are not watching. But those two things don't affect the above code, which ain't right. You are creating a table object (that should read Table) but not giving it a size (line 143). You then create a second table object in line 144 and give it a size, but never set it visible. You only want one table object.
 
Saloon Keeper
Posts: 15530
364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Les, I would recommend against calling pack() or setVisible() in the constructor, because a constructor should do nothing more than set up the object, while these two methods may kick off new threads. If you don't want to extend JFrame (I'm ambivalent about this, but Campbell discourages extending), call setVisible() and pack() in a separate show() method.

Even though most of the time it seems to work, I also recommend calling these methods on the EDT:
 
Campbell Ritchie
Marshal
Posts: 79240
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I said probably. I think you will learn better programming if you only extend classes when you have to. But I am not going to try to be definite about this.
You can extend frame to add components to it. Or you can have a method which adds the same components. Why extend when you can do the same without extending?

You can extend frame to add business logic to it. Now that is bad design indeed.
 
Stephan van Hulst
Saloon Keeper
Posts: 15530
364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fully agree.
 
Campbell Ritchie
Marshal
Posts: 79240
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even though I have seen books with business logic inside Frames.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic