Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Swings

  Asked By: Ayden    Date: Jun 15    Category: Java    Views: 571
  

All i have question regarding GUI programming in java
i am new to java , i want to create an interface of a simple
calcualator(like in windows) using swings

first i want to know which Layout manager is sutible for developing
such type of application .
second i want the minimize , maximies buttons and resize disable
how to do that..

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Eddie Austin     Answered On: Jun 15

A good layout  manager for variable sized forms is GridBagLayout.

Sorry I cant answer your previous question, but perhaps use JFrame.

 
Answer #2    Answered By: Antonio Dunn     Answered On: Jun 15

Be warned though ... GridBagLayout is insanly obscure, and painfull to
use at first.

 
Answer #3    Answered By: Holly Brown     Answered On: Jun 15

A regular GridLayout would be very easy to use for a calculator.

 
Answer #4    Answered By: Maliha Malik     Answered On: Jun 15

For a simple calculator , GridLayout is already sufficient though...

 
Answer #5    Answered By: Edward Jones     Answered On: Jun 15

Never tried, but i think you can use a window with a desktoppane and a
JInternalFrame.
Whith Jinternalframe you can have those buttons  disabled.

 
Answer #6    Answered By: Lewis Welch     Answered On: Jun 15

For a swing container without maximize and minimize  buttons extend a
JDialog, try something like this:

class TestDialog extends javax.swing.JDialog
{

TestDialog()
{
setDefaultCloseOperation(javax.swing.JDialog.DO_NOTHING_ON_CLOSE);
addWindowListener( new java.awt.event.WindowAdapter()
{
public void windowClosing(java.awt.event.WindowEvent e)
{
System.exit(0);
}
} );
setResizable(false);
setBounds(0,0,100,100);
setVisible(true);
}

public static void main(String[] args)
{
TestDialog thisDialog = new TestDialog();
}

}

 
Didn't find what you were looking for? Find more on Swings Or get search suggestion and latest updates.




Tagged: