Solved

JDialog minimizing

Posted on 2001-08-13
4
2,649 Views
Last Modified: 2012-06-21
Hello,

I was wondering if the top level JDialog can have a minimize button ? I found how to do it for a JInternalFrame but I don't think I can use this as my top level window for the application (is this correct ?)

------ code----------
ABConsole m_console = new ABConsole();
m_console.show();
------ end code------

where :

ABConsole is

------ code----------
public class ABConsole extends JDialog
{
.....
}
------ end code------

what do I need to do to enable the "minimize" button in the title bar?
0
Comment
Question by:tomschuring1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Sendoh earned 50 total points
ID: 6382698
hi !
dont think u can make it using JDialog...
since it has been design to be in this way...
in order to fulfill ur requirement...
u can try using a normal frame or window to sinmulate as a dialog...:)

hope it helps...
0
 
LVL 6

Expert Comment

by:kotan
ID: 6382719
try this,

public class ABConsole extends javax.swing.JDialog {

    public ABConsole(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    private void initComponents() {
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });
       
        pack();
    }

    /** Closes the dialog */
    private void closeDialog(java.awt.event.WindowEvent evt) {
        setVisible(false);
        dispose();
     System.exit(1);
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
     new ABConsole(new javax.swing.JFrame(), true).show();
    }
}
0
 

Author Comment

by:tomschuring1
ID: 6382736
Hi Kotan, that just kills the whole dialog. I was looking for a minimize button.
0
 

Author Comment

by:tomschuring1
ID: 6382740
perhaps it is 'abusing' the JDialog functionality. I decided to go with a Frame instead. thanks
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question