Minimisation and controlling button clicks in swings

Hello All,
I had some problem in swings.
Here I am giving my problem in detail.
1st ......
On one window named as "Main Screen" contains two buttons.
Say Button1 and Button2.
By clicking on Button1 another window will be opened named as "Sub Screen1".
By clicking on Button2 another window will be opened named as "Sub Screen2".
I need clarifaction on minimisation.
If I minimise my main window "Main Screen" all windows which are opened have to be minimised.
What I mean is if Main window is minimised all subwindows are also to be minimised.
2nd ........
When Button1 window "Sub Screen1" is opened by clicking again on Button1 another window is opening.
How to control the next click until the first have to close.
If any one will have any idea please give reply as soon as possible.
ThankYou All,
Rajiv.V

Hi Rajiv,
I assume you are using JFrames in your app.
You could use the Windowiconified method for your MainScreen and call SubScreen1.setState(Frame.ICONIFIED) and SubScreen2.setState(Frame.ICONIFIED). When you have pressed Button1 the instance of SubScreen1 is not null so you can do sth like this:Button1_actionPerformed(ActionEvent e()){
  if (SubScreen1 == null)
     SubScreen1 = new Frame(..);// or new SubScreen()
  else
     SubScreen1.setvisible(true);
}Phil

Similar Messages

  • How do I get my Close, Minimise and Maximise Buttons to Show

    When I first installed Photoshop CS6 Extended on my Mac it had a bar running along the top that had the program name in it (Photoshop) with the red, orange and green, close, minimise and maximise buttons in it.
    Somehow I have turned this off and the three buttons no longer show. Below is an example picture of the bar I'm wanting to turn on:
    I have the application frame turned on and they still do not show. I'm sure the answers simple, however any help would be hugely appreciated.

    Would this help solve the following issue:
    Like most people, I work with most of the CS6 programs open at the same time.  If I tweak a graphic from Photoshop and then return to Illustrator or InDesign to see how the updated graphic will appear, my usual mode of doing so would be to hit "Command-W" to close the Photoshop window/work environment/application frame - or whatever one calls it.  Then, I'd click on the program beneath to see the update occur.  In CS5, that worked just fine.  Command-W and Photoshop was out of the way.  With CS6, I hit Command-W and the opaque application frame/workspace is still there and I can't seem to get it out of the way without using Control/Comman/M.  I figure that I'm missing something rather elementary.  The new GUI of Illustrator and Photoshop is bad enough (flat Windows mess) without this little annoyance.
    Thanks.
    PS: Well, it was my "minimized" brain.  I had "Application Frame" selected in the Window menu.
    PPS: the GUI is still Windows-Ugly.  Any ideas?
    Message was edited by: SlamDesi

  • Cannot change command and control button

    in the past I've been able to switch the command and control buttons from system preferences. I recently connected a new Microsoft keyboard to my mac mini, and when I change the command and control button the same way I did before, it has no affect. The command and control keys have their default action. Is there a way to over ride this?

    I did on Lenono brand windows keyboard and it works, but when I try a Microsoft brand windows keyboard, it doesnt work.

  • Minimise and maximise buttons in Flex Store

    Hi,
    I'm writing a Flex app and would like to implement something
    similar to the Flex Store's minimise and maximise buttons. I know
    how to add an icon using titleIcon in the Panel properties but I
    would like to add two buttons to the panel header. Can anyone give
    me any ideas on how to add these buttons to the header of the
    panel?
    Thanks in advance,
    Pete

    Hi
    I'm trying to do something similar and I'm looking at the
    code from Flexstore to work out what is going on.
    The problem I'm having is I keep getting:
    "Access of undefined property titleBar"
    "Access of undefined property statusTextField"
    "Access of undefined property titelTextField"
    Is there something obvious that I'm missing? I'm really new
    to Flex and it could be something obvious.
    I wondered if it was something to do with the changes made
    for the final release, but when I downloaded the Flexstore source I
    got it to work locally.
    Here is the code I'm using that is sat inside a panel
    component:
    <mx:Script>
    <![CDATA[
    import mx.core.IUIComponent;
    import mx.effects.Move;
    import mx.containers.Panel;
    [Bindable]
    private var titleButtons:CatalogTitleButtons;
    override protected function createChildren():void
    super.createChildren();
    titleButtons = new CatalogTitleButtons();
    titleBar.addChild(titleButtons);
    override protected function
    layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void
    super.layoutChrome(unscaledWidth, unscaledHeight);
    titleButtons.width = unscaledWidth / 2;
    titleButtons.height = titleButtons.measuredHeight;
    titleButtons.move(statusTextField.x - titleButtons.width,
    titleTextField.y);
    ]]>
    </mx:Script>
    Any advice would be great.
    Thanks
    Elsa

  • Tab and control buttons do not work in Firefox (they work in other browsers) AND I switched to a new keyboard.

    The tab and control buttons are not working the Firefox browser (My browser is up-to-date). The buttons work in IE and Chrome, however, before I realized that, I even switched out my keyboard to a brand new one hoping it would solve the issue.

    Thank you--there were a few random extensions I had not added (spyware, maybe?). Once I removed those the issue was fixed!

  • How to remap keyboard - Looking to switch the "fn" and "control" buttons?

    Hi I was looking for a way to switch the function and control on the bottom left side of the keyboard on my macbook pro laptop. I am used to the control button being the button that is furthest to the left and its just really throwing me off having the fn key all the way to the left. If anyone knows how to remap these keys, I would really appreciate the help.
    Thank you.

    Firefox 4.0 has a combined Reload and Stop and Go button that appears at the right end of the location bar.
    To restore the Firefox 3 appearance you can use these steps:
    * Open the "View > Toolbars > Customize" window to move the Stop and Reload button out of the location bar.
    * Move the Reload and Stop buttons to their previous position at the left side of the location bar.
    * Set the order to "Reload - Stop" to get a combined "Reload/Stop" button.
    * Set the order to "Stop - Reload" or separate them otherwise to get two distinct buttons.

  • Having Trouble Closing a JFrame With a Button Click in Swing

    I am brand new to Java so this is probably something really stupid.
    On my main form I have a table displaying records from a database. When you double click a record, it pops up a second form showing the details of that record. You can then edit the data in this second form and click a "save" button which saves the data to the database. I want this button to also close that second form, however in the button click event, the second form variable is null.
    Here is some code showing the basic concept:
    public class SampleForm {
        private JButton  saveJobButton;
        private JFrame frame;
        private JFrame editDetailFrame;
        public static void main(String[] args) {
            SampleForm sample = new SampleForm();
            sample.createMainFrame();
        public void createMainFrame() {
            frame = new JFrame();
            JComponent panel = buildPanel(); 
            frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            frame.getContentPane().add(panel); 
            frame.pack();
            frame.setVisible(true);
        public void createEditFrame() {
            editDetailFrame = new JFrame();
            editDetailFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            JComponent editPanel = new SampleForm().buildDetailPanel();
            editDetailFrame.getContentPane().add(editPanel);
            editDetailFrame.pack();
            editDetailFrame.setVisible(true);
            editDetailFrame.validate();
    // save button
        private JButton getSaveJobButton() {
            if (saveJobButton == null) {
                saveJobButton = new JButton();
                saveJobButton.setText("Save Job");
                saveJobButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent e) {
                       .. saves data to database.
                        // here is where I thought the dispose() should go but the editDetailFrame is null at this point.
                        editDetailFrame.dispose();
            return saveJobButton;
        }Any assistance would be much appreciated.

    That handles the NullPointer, but still doesn't close my second Frame. The editDetailFrame should not be null at this point as I am clicking a button on the editDetailFram itself so I think the problem is that I just don't have a reference to the actual object at that point and my variable is just an empty one.

  • User account control message displays every time, minimise and close buttons not displaying, pages slow to load

    Every time I try to open a page, I get a user account control message asking for permission to proceed. I have tried to adjust the frequency of this but have been unsuccessful. This has only started to occur recently.
    Pages are slow to load and do not properly display the close, minimise etc buttons in the top right corner (these are blacked out)
    I have tried to reset firefox. This does not fix the problem.
    The problem does not occur using Internet Explorer

    There are several things to try.
    Some problems occurs when your Internet security program was set to trust the
    previous version of Firefox, but no longer recognizes your updated version as
    trusted. Now how to fix the problem: To allow Firefox to connect to the Internet
    again;
    * Make sure your Internet security software is up-to-date (i.e. you are running the latest version)
    * Remove Firefox from your program's list of trusted or recognized programs, then add it back. For detailed instructions, see
    '''[https://support.mozilla.org/en-US/kb/configure-firewalls-so-firefox-can-access-internet?esab=a&s=Configure+firewalls+&r=0&as=s Configure firewalls so that Firefox can access the Internet.]''' {web link}

  • Calling default browser on button click in swings

    Hi all,
    I have built a window with tab page in it having a button on tabpage in java SWING. Now i want that when ever i click on button it calls my default browser i.e. IE6 with a predefined URL. The browser should open with in the tabpage area not beyond that. Please help........ Many people have helped till now because i am very new to this.......
    Again looking for help from experts................

    I feel like I answer this almost everyday
    search the web for JDIC and webbrowser

  • Satellite U400: Need Vista install order and Control buttons don't work

    I bought an Satellite U400-11T model with french windows Vista.
    I want to change the french Vista to hungarian Vista.
    Of course I bought a legal vista HUN and downloaded the drivers etc.
    I am interrested in about the install order called installation instruction like at the XP models.
    My second problem is; I have already installed the new Vista HUN and the 6 easy key touch buttons don't work anymore.
    Where can I switch on it or wich program must i reinstall?
    Thanks
    Schmid

    Hi
    The installations order for Satellite U400 should be as follow:
    Windows Vista SP1
    Intel(R) Chipset Module
    Intel(R) Robson(Intel iMSM Driver)
    Intel(R) Crestline-GM / UMA Driver or AMD M82XT /M86 Driver V8.452.2
    Conexant CX20561 Audio Driver
    Marvell 8040/8055 LAN Driver
    Synaptics Touch Pad Driver
    Alps Touch Pad Driver
    Conexant Modem Driver
    Netwaiting
    Modem Region Select Utility
    Wireless LAN Driver
    Chicony Camera Software
    Bluetooth Stack for Windows by Toshiba
    CIR Port Driver V7.1.62.2012
    TOSHIBA Value Added Package
    TOSHIBA Hardware Setup Utility
    TOSHIBA Supervisor Password
    TOSHIBA SD Memory Utilities
    Authentec AES1610 Fingerprint Utility
    TOSHIBA ConfigFree
    TOSHIBA WPS Library
    TOSHIBA Assist
    TOSHIBA Speech System
    TOSHIBA Extended Tiles for Windows Mobility Center
    TOSHIBA Remote Control Manager
    CD/DVD Drive Acoustic Silencer V2.02.00
    Toshiba HDD Protection
    TOSHIBA Face Recognition
    TOSHIBA TRS Driver
    Broadcom
    HDMI Control Manager
    Please do not ask me about single tools. Install all offered stuff following this list and I hope everything will work well.
    Bye

  • UIManager.look and feel buttons or javax.swing

    Hey,
    i want to use the ok, cancel etc. button that you get in a JFileChooser or a JOptionPane.
    Can they be found in the UIManager or in the javax.swing?
    i tried to extract them from the JFileChooser by:
    JFileChooser chooser = new JFileChooser("/"); //Linux
    JPanel mypanel = new JPanel();
    mypanel.add(chooser.getComponentAt(2)); //the button panelthis works, but i don't know how to overwrite the actionlistener to make the buttons listen to my actionlistener.
    thanks in advance
    Grad_

    It returns an int value according to what button was clicked
    http://72.5.124.55/docs/books/tutorial/uiswing/components/filechooser.html
    http://java.sun.com/developer/JDCTechTips/2004/tt0316.html

  • When I want to zoom in or zoom out with the mouse wheel and CONTROL button the letters get larger but remain within the same size paragraph and any pictures remain the same. I want the entire page to zoom.

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/866940]]</blockquote>
    I want the entire page to zoom in and out when I use CONTROL + mouse wheel. Now the letters get larger but remain in the same size paragraph and also the pictures stay the same.

    It is indeed scandalous that Apple sells useless scanned music scores. There is a warning when you chose to download music tabs or notes but it doesn't say that the score lines are very small and cannot be zoomed. I spent $30 on two books but cannot really use them on my MBA as you cannot zoom except for the double click which only works page per page and is only a small improvement.
    The only way I can use the score more or less is on my ipad in landscape mode by increasing the font size to the max. The music score then becomes wider and you can read 2-3 lines per page without glasses.
    If you could transfer the file to the pdf  "side" of the library in ibooks the zoom would work..
    What does work is using the accessibility zoom mode option+command+= to zoom and then option+command+\ to smooth the picture but then your whole display desktop etc. are zoomed in.

  • Maximise,minimise and close button of Jframe to be disabled

    Please help me out to to disable the close,maximise and minimise button of Jframe

    Use the
    setUndecorated(boolean ); method of JFrame
    or
    Use the Dialog
    or
    set resizable false

  • When open Mozilla it displays only an a blank screen,the only visual is the minimise and close buttons

    Operating system:Windows 7 64.b
    Ram 2gb:
    This bug is generated every time i try to open Mozilla ,it looks like its open a window but everything is black or with some.Everything is invisible except the closing and minimise button at the top-right corner!Its just like a big blank window with three buttons!

    Hi Philip
    The thing is that i don't have access to any option of the mozilla,safe mode also doesn't work.They haven't been any updates on the computer just start behave that way

  • X230t and Windows 8 - tablet rotate and control buttons don't work

    I am the proud owner of a new x230 tablet and I couldn't resist the tempation to load up Windows 8 on it.  Overall I have found the operating system to work fairly well on the system as installed "out of the box"; however, I have noticed that when the computer is put in tablet mode the screen doesn't rotate, even if the rotate hardware button is pressed.  Has anyone else encountered this and if so is there a solution other then waiting for the official release of the operating system and windows 8 certified drivers.
    Thanks

    This is for win7 but should also work in win8 because it is a simple configuration thing:
    http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/how-torotate-screen-in-windows-7-...
    similar:
    http://answers.yahoo.com/question/index?qid=20070808054356AAufqKb
    Using x230t (i5-3320M, 8GB RAM, 256GB SSD, 80GB mSata-SSD) and loving it!
    "I may not own the world but I own my mind and therefore the world is at my feets." (me)

Maybe you are looking for

  • HT1848 transfered ipod apps and music to library on mac, updated iPod, now want to transfer apps and music back to iPod.  How do I do it?

    I transfered apps and music from my ipod touch to my library on my mac before updating my ipod touch to version 6.0, now how do I get music and apps back on ipod touch.  I can see them in my library on my mac.

  • SAP report: Tcode - S_ALR_87012093

    The dynamic selection for business area does not work for report S_ALR_87012093. Are there any sap notes for correction or other way out to get report output based on Business Area? To recreated problem 1. Go to Tcode S_ALR_87012093 2. Select dynamic

  • XI study material needed

    Hi Everyone,   I'm an abaper and now I would really like to learn XI.  can anyone tell me where can I find good study material for beginners like me. I need some tutorials that explains everything from scratch. thanks in advance. Pooja.

  • Remote: Albums sortet by album names and not by "Interpret"

    Hi, Why Remote sort the albums by album name? this is the second bug which is not "fixed" with the new version 2.0 of Remote. Again with the "Compilation" problem in my previous post I'm wondering why nobody is asking for that "bug"? The best solutio

  • Banding in the Layer Mask?

    Hello, I have: Windows Xp Service Pack 3 4GB RAM Geforce 560ti PS CS5 extended I am a photographer and submit the images to an agency.They inspect images at 100% for technical quality. While preparing an image today, I used a layer mask in the levels