Disable "Close" in Frames

How am I able to disable the "Close" icon located at the top-right corner of a Frame?
Cos I do not want the user to click that icon
thanks

Thanks for your advice. I know of that one. Just that it's a bit confusing to the users. What I want is that the "Close" button is DISABLED, so that users cannot click on the button.

Similar Messages

  • Close a fram

    i want to close a frame after i click a button... i have the button setup and added an action listener to it then i perform the functions i need performed but after everything is done i would like to exit or close the entire frame... how can i do that?

    <implement beatnik>
    uh... OP question I am assuming has to do with :
    myFrame.setVisible(false);//hides frame
    myFrame.dispose();//prepares frame for disposal - doesn't actually dispose as you could call setVisible()
    myFrame = null;//kill your reference.
    System.gc();//cross your fingers and hope like hell that the GarbageCollecter gets the message... all better ?
    :)

  • Close a Frame when another one opened

    How do i Close a frame (dependent Frame) when another frame opened
    dispose() method did nothing and so do system.exit(0); as the System.exit(0) close the whole app that meant also the frame i would like to open when the other frame closed and moved from " Memory " huge topic for me
    dispose(); didn't do what i really needed to happened
    please any suggestions ASAP ? i need that in swing app

    i used dispose() but didn't work with me as i noticed the memory usage with this java app when i run the app after closing the frame . the memory usage didn't change that meant as least the frame didn't closed or cleared from the memory ?!
            try {
                    Socket ss = new Socket("14.23.5.122", 1235);
                  //  JOptionPane.showMessageDialog(null, "Server's OK", "Connection", JOptionPane.INFORMATION_MESSAGE);
                    new LoginFrame().setVisible(true);
                  //  this.dispose();
                    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                } catch (UnknownHostException eh) {
                    System.out.println("Unknow Host Exception"+ eh.getMessage());
                } catch (IOException eo) {
                    System.exit(0);
                   System.out.println("IO Exception"+ eo.getMessage());
             /*finally{
            System.exit(0);
            }*/

  • CS4 - Is it possible to disable the application frame?

    I have been cursing and hating the application frame in Windows for the last month, but now I get my hands on the Mac version, I'm discovering my days of cursing have only just begun it seems.
    In the Mac version of InDesign/Photoshop/Illustrator they at least provided a way to disable the application frame, but I'm not seeing the same thing in Flash.
    Am I blind or did they truly not include the option?!
    Options for people that want them are fine. Universal decisions that some company knows better how to do UI for an app than the primary OS it is running in make me want to set a UI engineer on fire.

    Hello,
    >> I need to disable the export button/functionality in a customer's apex installation (3.2.1) as part of the security measures.
    >> this need applies for both development and production enviroments although if a solution is available, it will be first tried in the development enviroment.
    I agree with Tyler, this is indeed a really strange request. If your customer can’t rely on his developers, I would say you have a problem. I’m saying it because disabling the export button, even if it’s possible, doesn’t really give you any kind of protection. A malicious developer can still export APEX application using the Java utility APEXExport; it can be done with SQL Developer; it can also be done on a page level, and I only named the documented options.
    I don’t think this type of action should be considered for a development environment. Of course, the production environment is a completely different ball game. You can use the APEX run-time only environment, and by that neutralize most of the developer related “risks”.
    Just my 2 ¢,
    Arie.

  • Disable/remove black frame around document

    Is there anyway to temporary disable the black frame around a document?
    Sometimes when I design it irritates me to have this frame. Of course I can make a larger document, but sometimes I realize the document isn't large enough and I want to go outside the frame and then it would be nice to temporary remove it.
    By the way, is there a way to change the size of a document once it's created?

    Joan,
    View>Hide Artboard.
    You can always File>Document Setup and change different things. In newer versions, you can use the Artboard Tool.

  • Close a frame

    Hi.
    Instead of exit the application at the line System.exit(0); I just want to close the frame or hide it.
    I have tryed with the lines that are commented, but it didn't work.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class PaginaPrincipala extends JPanel implements ActionListener {                               
        private static String EXIT = "exit";
        private JFrame controllingFrame;
            public static String user;
            JPanel panel;
            //JFrame f;
        public static void FereastraPrincipala(String inUser) {
             user = inUser;
            JFrame.setDefaultLookAndFeelDecorated(true);
            JFrame frame = new JFrame("PaginaPrincipala");       
            frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            final PaginaPrincipala newContentPane = new PaginaPrincipala();
            newContentPane.setOpaque(true);
            frame.setContentPane(newContentPane);
            newContentPane.ContinutPaginaPrincipala(frame);
            frame.addWindowListener(new WindowAdapter() {
                public void windowActivated(WindowEvent e) {
                    newContentPane.resetFocus();
            frame.pack();
            frame.setExtendedState(frame.MAXIMIZED_BOTH);
            frame.setVisible(true);
            frame.toFront();       
            //f = frame;    
        public void ContinutPaginaPrincipala(JFrame f) {
             panel = new JPanel();         
             GridLayout layout = new GridLayout(5, 2, 5, 5);
              panel.setLayout(layout);
              JTextField campTempUser = new JTextField(20);
              JButton butonExit = new JButton("Exit");
            butonExit.setActionCommand(EXIT);
            butonExit.addActionListener(this);
              add(panel);
              panel.add(butonExit);                          
        public void actionPerformed(ActionEvent e) {
            String cmd = e.getActionCommand(); 
            if (LOGIN.equals(cmd)) {              
            if (EXIT.equals(cmd)) {
                 InregistrareLaInchidereaAplicatiei inregistrareLaInchidereaAplicatiei = new InregistrareLaInchidereaAplicatiei();
                inregistrareLaInchidereaAplicatiei.InregistrareInDB(user);
                 System.exit(0);     
              //frame.setVisible(false);
    }

    "And if he still doesn't answer ?"
    Yes, I have tried, but it still doesn't work. And I feel that it must be so simple.
    When I click the Exit button, the frame must disappear.
    Here is the code with the main function:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class PaginaPrincipala extends JPanel implements ActionListener {
        private static String EXIT = "exit";
        private JFrame controllingFrame; //este nevoie pt dialoguri.
            public static String user;
            JPanel panel;
            JFrame f;
       public void FereastraPrincipala() {
             //user = inUser;
            //setari pt grafica ferestrei.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //creeaza si seteaza fereastra.
            JFrame frame = new JFrame("PaginaPrincipala");      
            frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            //creeaza si seteaza 'content pane'.
            final PaginaPrincipala newContentPane = new PaginaPrincipala();
            newContentPane.setOpaque(true);
            frame.setContentPane(newContentPane);
            newContentPane.ContinutPaginaPrincipala(frame);
            //seteaza focusul pe 'content pane'.
            frame.addWindowListener(new WindowAdapter() {
                public void windowActivated(WindowEvent e) {
                    newContentPane.resetFocus();
            //Afiseaza fereastra.
            frame.pack();
            frame.setExtendedState(frame.MAXIMIZED_BOTH);
            frame.setVisible(true);
            frame.toFront();      
            f = frame;
        public void ContinutPaginaPrincipala(JFrame f) {
             panel = new JPanel();         
             GridLayout layout = new GridLayout(5, 2, 5, 5);
              panel.setLayout(layout);
              JTextField campTempUser = new JTextField(20);
            //Butonul 'EXIT'
            JButton butonExit = new JButton("Exit");
            butonExit.setActionCommand(EXIT);
            butonExit.addActionListener(this);
              add(panel);
              panel.add(butonExit);                          
        public void actionPerformed(ActionEvent e) {
            String cmd = e.getActionCommand();       
            //daca se apasa EXIT se sterge userul din DB-ul cu userii activi si se iese din aplicatie
            if (EXIT.equals(cmd)) {
                 //System.exit(0);
                 Toolkit.getDefaultToolkit().beep();     
                 f.setVisible(false);
        public static void main(String args[]) {
             PaginaPrincipala fer = new PaginaPrincipala();
             fer.FereastraPrincipala();
        //Muta focusul pe campul de user.
        protected void resetFocus() {
            //campLogin.requestFocusInWindow();
    }

  • Disable close button of a portlet?

    Hi,
    How can I disable close button of a portlet programettically? I have a requirement to disable a portlet based on some condition from another portlet. If the condition is true I have to display a portlet with close button in window bar.Otherwise display the portlet without close button.
    Thanks
    Pradeep

    We actually modified the buttondelete.jsp in frameworks.
    Kunal Mittal

  • Disable close opearion(X) on the title bar of a frame.

    Hai,
    I need to disable the close operation on the title bar of the frame.
    Can anyone give me the solution.
    Thanks
    SmartStar.

    hai,
    the code given is allowing me not to colse the frame, but it is not displaying the frame with the size i had given in the setSize().
    I need a code to achive a task such that, even after i click on the close on the title bar, it should not perform any function and display the frame as it is. with out any resizing.

  • Disable close icon on title bar

    Is it possible to disable the close icon on the title bar (right hand corner) in a swing window?
    Fai.

    Example:
    frameNameHere.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    There is also the option to take away the "window-frame" alltogether with:
    frameNameHere.setUndecorated(true);
    Though if you do that you should probably use the "DO_NOTHING_ON_CLOSE" anyway, since otherwise it can still be closed with Alt F4 for instance.

  • Disable Close icon

    Hi
    I saw different posts on this topic but found no solution to let it work for me .
    Under 1.4 and Windows L&F what is the correct way to disable or remove the close icon in the title bar of a JFrame?
    Thanks in advance
    Wolfgang R.

    Call the method
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    On your frame. This will prevent the frame from beeing closed when the user clicks on the little "x" in the title bar. I think this is as far as you get, you can't really disable the button on a frame. If you don't want the button, use a JWindow instead of the JFrame. (JWindow has no decorations).
    By the way, you can still assign a WindowListener to the frame. windowClosing will still be called when the user clicks on the close button (even when the window will not actually close). You can add a close dialog threre and close the window manually.
    Regards
    Der Hinterwaeldler

  • How to close all frames in a page?

    friends..
    im having a html page(test.html) which has 3 frames.
    in one frame im having BACK button which takes me to the
    default page.
    But the problem is, when i click BACK button it loads the default.html in same frame itself...i want to open default.html as complete page..
    help out me...

    Have not tested this ..but I would suggest you to try something close to this ...
    <input type="button" name ="xyz" value="BacK"
    onClick="javascript: parent.framename.window.href='/default.html'">Change the 'framename' to the one you have assigned.
    Hope it works ..else research on the above lines only
    -Rohit

  • Help with disabling close icon of last opened tab in JTabbedPane

    Hello
    Would someone help me out ? I have 3 tabs opened in a JTabbedPane, each with close icon "X". I am looking for a way to tell my program: if the user closes 2 tabs and only 1 remain, disable the close icon "X" of the last opened tab so that the user is unable to close the last tab. I have searched the forum, most I have run into are how to create the close icon. Would someone give me some insight into how to go about doing this? or if you have come across a forum that discusses this, do please post the link. Also, I am using java 1.6.
    Thanks very much in advance

    On each close, look how many tabs are remaining open in the JTabbedPane (getTabCount).
    If there is only one left, set its close button to invisible. Something like this:
    if (pane.getTabCount() == 1) {
        TabCloseButton tcb = (TabCloseButton) pane.getTabComponentAt(0);
        tcb.getBtClose().setVisible(false);
    }

  • How to disable close & minimize button of jframe?

    how can i disable the close and minimize button of the Jframe?

    to disable minimize
    setResizeable(false);
    to inactivate the close button
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

  • Disable Close Tab Button on all Tabs Broken in v5 (31.0)

    Firefox 5 (v31.0) has broken browser.tabs.closebuttons = 2
    That setting is 2 in my about:config, also I have Tab Control 5.5 with Close Buttons = None.
    Either way the latest Firefox is ignoring both settings and now displaying an X on my active tab.
    Along with the new interface of the tabs is overlaping the tabs next to it and causing me to close tabs instead of switching tabs.
    Is this another case where Firefox knows best, and just changes things because they can?
    What is the proper 'new' code to totally disable the X on all tabs?

    I'm still trying to figure out why the add-ons bar was removed. As
    are many hundreds of other users.

  • Disabling close 'X' icon in the title bar of JDialog

    I found that JDialogs by default come up with the close 'X' icon. The only manipulation that can be done is by setting the DefaultCloseOperation.
    Is there some way I can avoid showing that icon on the title bar?
    My JDialog already has a 'Close' button and I have written an action listener for it. I dont want to listen to WindowEvents as well.

    JDialog d = new JDialog((Frame)c, true);
    d.setSize(400,300);
    d.setUndecorated(true);
    d.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);That bit of code seems to get rid of the title bar entirely and cause a MetalLookAndFeel dragging bar without an X to appear.
    Let me know if this is a satisfying solution
    My full test code followsimport java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DyalogTest extends JFrame
       public DyalogTest()
          super("Dialog Test");
          setSize(500, 400);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container c = getContentPane();
          c.setLayout(new FlowLayout());
          JButton b = new JButton("Initiate Dialog");
          b.addActionListener(new ActionListener()
             public void actionPerformed(ActionEvent e)
                Component c = SwingUtilities.getRoot((Component)e.getSource());
                JDialog d = new JDialog((Frame)c, true);
                d.setUndecorated(true);
                d.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
                JButton b = new JButton("Dispose");
                b.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                      Component c = SwingUtilities.getRoot((Component)e.getSource());
                      JDialog d = (JDialog)c;
                      d.setVisible(false);
                      d.dispose();
                d.getContentPane().setLayout(new FlowLayout());
                JPanel p = new JPanel();
                p.setPreferredSize(new Dimension(400,300));
                p.setBorder(BorderFactory.createTitledBorder("Vanilla Dialog"));
                p.add(b);
                d.setContentPane(p);
                d.pack();
                d.setVisible(true);
          c.add(b);
       public static void main(String[] args)
          new DyalogTest().setVisible(true);
    }

Maybe you are looking for

  • Need to send a private message to customer care

    Hello, ! Thanks for posting. You should be able to click here to send us a private message! You won't have to input your username at all; just the message subject and body. See the screencaps below. Let me know if you have any other questions! -Mari

  • Urgent-page printing

    Hi experts, My clients requirement is that the page should stop printing automatically without ht epaper being exited by the printer , if the page is not full.Is this possible. For example print two gr's on the same page

  • 802.1x EAP-PEAP - Radius Question

    We're going to be deploying a wireless solution to a customer at some point shortly. So far we have a WLC 2500 Series, 1140 LAPs, and a 2960-S switch. We're going to have Windows 7, iPhone, iPAD devices, and I was going to implement 802.1x EAP-PEAP.

  • Update email/log in for icloud

    I updated my email and apple Id and password through my laptop.  However, on my iphone 4S, when I go to the icloud it sill has my previous email address, which I no longer have any access to.  No I can not access anything associated with the icloud o

  • Cinexplayer Problems with .AVI

    I have an iPad 2 and I have made movies on .avi that I want to bring along to show for my work. I tried using 0PlayerHD Lite, but I couldn't get a big .avi file on there, so I downloaded CineXPlayer. You can hear the movie perfectly, but the video do