How to blink the tab of a minimized JFrame?

Hi,
I am creating a chat software. When a message comes for a specific jframe, how can we start that minimized jframe to blink. In this way, the user knows that message has arrived.
Thanks
Karar Haider

you need to use the Frame.setIconImage() method to change the icon.
in order to flash the icon use something like this (this is for a flashing JLabel, but you can easily change that to flash the icon):
public class FlashLabel extends JLabel implements Runnable {
    public static final int NORMAL_COLOR = 0,
                            FLASH_COLOR = 1;
    private Color           colors[] = new Color[2];
    private int             well = 500;
    public FlashLabel(String text, int horizontalAlignment) {
        super(text, horizontalAlignment);
        colors[NORMAL_COLOR] = getBackground();
    public void setFlashColor(Color c) {
        colors[FLASH_COLOR] = c;
        setOpaque(true);
    public void startFlashing() {
        Thread t = new Thread(this);
        t.start();
    public void setTime(int t) { well = t; }
    public int getTime() { return well; }
    public void run() {
        int current = 0;
        try {
            while (true) {
                setBackground(colors[current]);
                current ^= 1;
                Thread.currentThread().sleep(well);
        } catch (InterruptedException e) { return; }
}you could also add a ComponentListener to your frame to get informed if and when your frames gets iconized in order to do the flashing only if the frame really is minimized.
thomas

Similar Messages

  • Plz help, How to blink the tab of a minimized JFrame?

    How it is possible to blink the tab of a minimized window in a chat software, when message is received.
    Karar

    Once the JFrame is minimized and placed in the tray ,then its not in your control.
    If you like to do anything ,then you have to make use of JNI.

  • How to change the tab order in adf forms.

    Hi,
    I design a from in adf jsff page.In the form i have 4 components. These components are surrounded with a panel form layout. Now if i put number of columns as 2 in the property inspector of the PFL.
    Components appear as 2 fields in the first row and next two fields are in the second row.
    Now my doubt is, when I tab out 1 field to another field. The tab out is Horizontal. But I want the tab out to be vertical. Please suggest how to make the tab out feature as vertical.
    Thanking in advance,
    Sudipta

    I don't think we have something called tab index in adf like in javascript. This may not possible in adf.

  • How to change the tabbing order of an array of clusters?

    How to change the tabbing order of an array of clusters?  I have the cluster arranged in table in the front panel.   The cluster element goes horizontal and array element goes vertically.   When I press the tab key, the cursor goes to the next array element instead of the next cluster item (down instead across).
    Solved!
    Go to Solution.

    Broken Arrow wrote:
    Harold asked a perfectly reasonable and necessary question, but how is that a Solution ???
    I believe it is called the Socratic Method.
    Sea-Story time
    I had the privledge of working for Ron Davis when he managed the Allegheny District of DEC. He was an ex-WO4 (Highest possilbe rank for non-commisioned officer in US Navy, required act of congress to confirm).
    Ron never answered any question I ever saw presented to him. I remember a group of managers in a frenzy over some issue  running to him to to see what he thought. He asked them a series of questions that lead them to the solution and soon they were smiling and slapping each other on the back as they walked away.
    Who is that has a signature that read "it is the questions that guide us"?
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • E-Rec 6.0: How to increase the tabs on Candidate Profile

    Hello,
    I'm trying to find out how to increase the tabs that we see on Candidate Profile. In any clients, only 5 tabs are visible on the profile and for more, the candidate clicks on next to view other tabs and then submit the profile. I searched for all configuration tables and code but could not find any.
    I appreciate if anyone could share this info if they know how to do this.
    Points would be awarded .
    Thank you
    K.

    Hi,
    You can configure the tabs at Technical Settings->User interfaces->Setting for BSP->Flexibilization->Container Sequences.
    if you want to add one tab, you have to define one element for container sequence and then assign it to the container of candidate profile at Modify Container Sequence.
    Best Regards,
    Shaoming

  • How to disable the tab focusing for a JTextField object because those ...

    Hi All,
    Here I need some help. I want to disable the tab focusing( tab index) for a JTextField objects because those objects are set as setEditable(false). Also can u tell me about how to change the tab index orders for JTextFields.
    Many thanks,
    Vijaycanaan.

    I want to disable the tab focusing( tab index) for a JTextField objectsLook through the API and find methods with the word "focus" in the method name.
    Also can u tell me about how to change the tab index orders for JTextFields."How to Use the Focus Sub System":
    http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html

  • How to remove the tabs such as "startnow", "Shoppings", "Games"?

    How to remove the tabs such as "startnow", "Shoppings", "Games"?

    When do you see those tabs?
    See these articles for some suggestions:
    *https://support.mozilla.com/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    *https://support.mozilla.com/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    *http://kb.mozillazine.org/Preferences_not_saved
    See also:
    *http://kb.mozillazine.org/Session_Restore

  • How to find the TAB details in the program - Urjent

    Hi All,
    There is a customized tab with details in a screen. How to see the customized tab details in the program. When I go and see in the status and program name, there are many includes written over there.
    I just want to go and see the details in the tab of the screen in the program. Please let me know how to see the TAB details in the program.
    Thanks,
    Ramana

    hi KCR,
             You have to place cursor on that tab and then you have to go to Status...There you can see the program name as well as screen number... You can go for screen number there you can see the flow logic and then you can confirm the screen after going in the layout......
             Just try and see.. and let me know..whether it works or not....
    rewards points if it helpful...
    Cheers,
    Sagun Desai....

  • How to change the tab on a web browser

        Hello,
    I do not know how to change the (index.html) tab. When you have several of the tab on your browser open, the name appears in the middle of tab, mine continues to say the INDEX.html. I just need to know how to go into dreamweaver and change the title tag. In the actual HTML I have changed it and it still hasn't worked. please help, thanks!

    Oh I see. You also posted another question about the page not working on mobile devices
    http://forums.adobe.com/thread/1342179
    The page name in the browser tab comes from the text inside the <title> tag.
    Line 5: <title>INDEX.html</title>

  • How to stop the tab bar from automatically hiding itself?

    ive only found how to stop the address bar from disappearing and everyone with the tab problem seems to have posted this over a week ago and still hasnt been fixed yet if noone has a fix im out and done with firefox they can suck a fat one
    why add this feature! i can understand the address bar but not the tabs all you have to do to hide it was push the tab button again and its gone was that so fucking hard that you had ruin a perfectly fine browser

    Hello,
    In Firefox 23, as part of an effort to simplify the Firefox options set and facilitate future improvements to Firefox, the option to hide the tab bar was removed.
    Fortunately, this can easily be resolved if you desire the keep tabs hidden. You can install "[https://addons.mozilla.org/firefox/addon/hide-tab-bar-with-one-tab/ Hide tab bar with one tab]", an extension hosted on Mozilla's add-ons site, which will restore the ability to hide the tab bar.
    Thank you and I hope this helps!

  • How to see the Tabs in Aurora( windows 8 app ) ? I only can see them by oppening a new tab. But In case I want to change tab I can't see them.

    I Install Firefox Aurora as it support windows 8 style app. But In the windows 8 mode , the tab are hidden which I think is a good style. But I cant see any option to see them when I want. I just can see them when I open a new window. And select the option "open in the new window", it just show the tab bar which is not like the original version of Firefox. And also the search engine here is bing.com . How to change it.

    Where did you see Aurora as a Windows 8 application?
    Aurora is not the name of a version but one of the four main development channels. They are Release (26.0), Beta (27.0b9 currently), Aurora (28.0a2) and Nightly (29.0a1). When Firefox 27.0 is released on Feb 4 the versions will move/merge to next channel around time also.
    Aurora is not meant for regular use as Aurora and Nightly gets checkins almost everyday and they get a update each of those days.
    Also there is a good chance that the Australis that many people dislike will move with 29.0 from Nightly to the Aurora channel next week.
    Edit:
    Hmm you may have seen older articles like https://blog.mozilla.org/futurereleases/2013/09/21/help-test-a-preview-of-firefox-optimized-for-windows-8-tablets/
    At the time of that article, version Firefox 26.0 was being developed early on the Aurora channel.

  • How to change the Tab name for a custom field added in IC Winclient

    I have successfully added a field using eewb and it is appearing on my transaction in CIC0 but it is on a tab that says Customer Fields.  In EEWB a BADI called ZEEW_CUSTOMER_H01 was generated and it has a methods called  CRM_CUSTOMER_H_SET_TITLE.  It indicates you should be able to use this to rename the tab but the method is empty.  Anyone have an example of the code you pass in to rename the tab screen.  Thanks, Lisa

    >>and how will it effect in the report?
    You wouldn't see any direct effect on the Report.. But if you transport the report to QA & leave the Message class in Dev, it might result in syntax issues & you will not be able to execute the report. Just ensure that both of them get transported to QA & you will be fine.
    ~Suresh

  • How to recognize the tab key in a JTextField

    I have a drawing program with a main window and a tools palette, which is a JDialog. The tools palette has JToggleButtons and one JTextField. When you have the focus in the JTextField and you press tab repeatedly, it tabs through all the JToggleButtons and then back into the JTextField.
    However I would like to recognize the pressing of the tab key and ask for the focus to go back to the main window.
    I subclassed the JTextField, added a KeyAdapter, but it does not recognize the tab key. I also added the processKeyBinding method, but it doesn't recognize the tab key either.
    How can I recognize the tab key?
    Here is a self-contained test program that illustrates the problem:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class AnanyaCurves extends JFrame
      Tools tools;
      public AnanyaCurves(Dimension windowSize)
        Basics.ananyaCurves = this;
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        setTitle("Ananya Curves");
        tools = new Tools(this);
      public static void main(String[] args)
        int toolsWidth;
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        toolsWidth = 200;
        Dimension windowSize = new Dimension(screenSize.width - toolsWidth, screenSize.height - 58);
        AnanyaCurves ananyaCurves = new AnanyaCurves(windowSize);
        ananyaCurves.pack();
        ananyaCurves.setBounds(toolsWidth, 0, windowSize.width, windowSize.height);
        ananyaCurves.setVisible(true);
        ananyaCurves.requestFocus();
      public void setVisible(boolean b)
        tools.setVisible(b);
        super.setVisible(b);
    class Basics extends java.lang.Object
      public static AnanyaCurves ananyaCurves;
      public Basics()
    class Tools extends JDialog
      JToggleButton btnGrid;
      JTextField textGrid;
      JPanel panel;
      public Tools(JFrame frame)
        super(frame, "Tools", false);
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        btnGrid = makeBtn("Grid");
        textGrid = makeTextField();
        panel = makePanel();
        pack();
      public JToggleButton makeBtn(String name)
        JToggleButton btn = new JToggleButton();
        btn.setMaximumSize(new Dimension(108, 24));
        btn.setPreferredSize(new Dimension(108, 24));
        btn.setText(name);
        btn.setFont(new Font("Verdana", Font.PLAIN, 11));
        btn.setMargin(new Insets(5, 10, 5, 10));
        btn.setOpaque(true);
        return btn;
      public ACJTextField makeTextField()
        ACJTextField textField = new ACJTextField();
        textField.setFont(new Font("Verdana", Font.PLAIN, 12));
        textField.setMaximumSize(new Dimension(108, 20));
        textField.setPreferredSize(new Dimension(108, 20));
        textField.setText("0.25");
        textField.setEnabled(true);
        return textField;
      public JPanel makePanel()
        JPanel panel = new JPanel();
        panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
        panel.add(btnGrid);
        panel.add(textGrid);
        getContentPane().add(panel);
        return panel;
    class ACJTextField extends JTextField
      KeyAdaption keyAdaption;
      public ACJTextField()
        super();
        keyAdaption = new KeyAdaption();
        this.addKeyListener(keyAdaption);
      class KeyAdaption extends KeyAdapter
        public void keyPressed(KeyEvent event)
          int keyCode = event.getKeyCode();
          if (keyCode == KeyEvent.VK_TAB)
            Basics.ananyaCurves.requestFocus();
      protected boolean processKeyBinding(KeyStroke keyStroke, KeyEvent keyEvent, int int2, boolean boolean3)
        int keyCode = keyEvent.getKeyCode();
        if (keyCode == KeyEvent.VK_TAB)
          Basics.ananyaCurves.requestFocus();
          return false;
        return super.processKeyBinding(keyStroke, keyEvent, int2, boolean3);
    }Thanks for looking at this.

    Wow, Michael, you work like magic! Thanks so much! I would be happy to give you a commercial key to my Ananya Curves program also once the second release is on my website. It's a program for drawing curves in an easier way without pulling on tangent lines, with all control points right on the curve. Just send me an email to [email protected] if you are interested!

  • How to define the "tab" ,"enter" character in a variable(type c)

    I want to use the define the "tab" key and
    "enter" key in a variable(type c),
    But I don't know how to write it :
    for example:
    data: a1 type c(1).
    data: a2 type c(1).
    a1 = ?. " the tab key
    a2 = ?. " the enter key

    Hi, i think joseph fryda gave you the one solution.
    In the server which doesn't support CL_ABAP_CHAR_UTILITIES, here is another solution.
    data:
        C_X1                  TYPE X VALUE '0D',
        C_X2                  TYPE X VALUE '0A',
        C_X3                  TYPE X VALUE '09',
        LC_ENTER(2)           TYPE C,
        LC_TAB                TYPE C.
    enter key
    CONCATENATE C_X1 C_X2 INTO LC_ENTER.
    TAB key
    LC_TAB = C_X3.

  • Coded UI -VSTS 2012 How to get the tab details from UITabContainerPane(UI Test Control)

    Hi Team,
    I am quite new to Coded UI. I am trying out the possibility of Coded UI for Spotfire Report Validations which is available in web portal. I have three tabs on my web page. How can get the list of tabs and act on each. In the recorded script i could see that
    under UITabContainerPane I can see the tab coming under UITabContainerPane(UITestControl). I am not sure from this parent how will i get the childs to get access to each tabs. Please advice.
    Thanks & Regards,
    Divya

    I tried the following code however when i do a quick watch on div i get a timeout.
    public partial class UIMap
            public void selectTab()
                HtmlDiv div = new HtmlDiv();
                div.SearchProperties[HtmlDiv.PropertyNames.Name] = "tab";
                HtmlControl controls = new HtmlControl();
                controls.SearchProperties.Add(HtmlControl.PropertyNames.Class, "singleTabContainer");
                UITestControlCollection collection = controls.FindMatchingControls();

Maybe you are looking for

  • Index usage with nls_sort and nls_comp

    Hi, I have created a logon trigger CREATE OR REPLACE TRIGGER "SYS"."ON_LOGON_SET__SCHEMA" AFTER LOGON ON DATABASE BEGIN EXECUTE IMMEDIATE 'alter session set NLS_SORT=BINARY_CI'; EXECUTE IMMEDIATE 'alter session set NLS_COMP=LINGUISTIC'; EXCEPTION WHE

  • How do i sync a subscribed ical to my iphone

    I run Snow Leopard on my Mac and 4.2.8 on my (Verizon) iPhone. I subscribed to a new calendar on my Mac but can't get it to show up on my iPhone. Non of my subscribed calendars, not even the birthdays one appear in MobileMe. Same for my iPod touch Ho

  • How to change the path of sysprep files that were copied to reference computer when i capture the image from reference.

    Dears ,, how to change the path that sysprep were copied to reference computer when i capture the image from reference. Should i modify some codes in LTIAPPLY.wsf? how to modify it? Thanks.

  • Marketing Attributes for BP

    How can i load the Marketing Attributes of the Business partner into BI. Is there any standard data souce??? what does it load into, the BP object??? Thank you

  • Iphone create playlist add all songs

    Since upgrading to iOS7.0.4 on my iPhone 4 I have to say I have been very frustrated and unhappy. Not only does my album art not match my songs after various syncs and deletes and resyncs, voice control keeps coming on to interrupt my music draining