Hi objects. I did suspect as much.
Seems like such a simple thing though.. have you stumbled upon any code which will help me?
Main Topics
Browse All TopicsG'day everyone.
I have a JFrame which I wish to remove or completely hide the Maximize button (on top right hand corner) yet leave the Minimize and Close buttons still showing.
I've tried a few things such as setting resizable to false ( frame.setResizable(false);
I have also tried using a JDialog instead of a JFrame but that seems to just show the close button, not the minimize.
Points to anyone who can show me the code to achieve what i want.
Cheers!
Howie
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> I wish to remove or completely hide the Maximize button
This is not possible on JFrame unless you no how to do painting method
What you could do however is to use JInternaFrame cause Internal Frames
is allowed to not to display the maximize button, something like this :
// Set up the components by true or false
JInternalFrame x = new JInternalFrame(false,true,
Hi Javatm, I've just had a play with JInternalFrame and as you said it does remove the minimize button.
But the main window remains open when you click minimize and close... are you suggesting i catch the event and pass it over to the parent? also i can't seem to find where i get rid of the title bar from the parent frame. One more thing, i have a LAF and it renders internal frames quite ugly...
I still prefer Object's proposed method at this stage.. as to avoid the above complications. Just like someone to post some code on how to get that working.
Try this :
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Word extends JWindow {
public Word()
{
super("Word Processor . . .");
JDesktopPane p1 = new JDesktopPane();
JInternalFrame f1 = new JInternalFrame("",false,tr
JTextArea txt1 = new JTextArea();
txt1.setSize(300,300);
f1.add(new JScrollPane(txt1));
f1.show();
p1.add(f1);
getContentPane().setLayout
getContentPane().add( p1, BorderLayout.CENTER);
setSize(500, 500);
show();
}
public static void main (String args[])
{
Word x = new Word();
x.setDefaultCloseOperation
}
}
Sorry I remebered that we are JWindow for us to remove the Titlebar
Its like this actually :
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Word extends JWindow {
public Word()
{
JDesktopPane p1 = new JDesktopPane();
JInternalFrame f1 = new JInternalFrame("Sample . . .",false,true,false,true);
JTextArea txt1 = new JTextArea();
txt1.setSize(300,300);
f1.add(new JScrollPane(txt1));
f1.show();
p1.add(f1);
getContentPane().setLayout
getContentPane().add( p1, BorderLayout.CENTER);
setSize(500, 500);
show();
}
public static void main (String args[])
{
Word x = new Word();
x.addWindowListener(
new WindowAdapter() {
public void windowClosing( WindowEvent e )
{
System.exit( 0 );
}
}
);
}
}
If you want to close the entire program just click on the "x" mark on the
Internal Frame w/ this codes :
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Word extends JWindow {
public Word()
{
JDesktopPane p1 = new JDesktopPane();
JInternalFrame f1 = new JInternalFrame("Sample . . .",false,true,false,true);
JTextArea txt1 = new JTextArea();
txt1.setSize(300,300);
f1.add(new JScrollPane(txt1));
f1.show();
p1.add(f1);
f1.setDefaultCloseOperatio
getContentPane().setLayout
getContentPane().add( p1, BorderLayout.CENTER);
setSize(500, 500);
show();
}
public static void main (String args[])
{
Word x = new Word();
}
}
Business Accounts
Answer for Membership
by: objectsPosted on 2003-11-18 at 20:07:07ID: 9776247
Think you'll need to handle painting the title bar yourself to achieve that.