Java Frame

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SarojaKannan
    New Member
    • Aug 2007
    • 8

    Java Frame

    I want to keep a frame designed in java in Task bar, so that what ever window i am opening my frame will be visible.

    Please tell me How to do this
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by SarojaKannan
    I want to keep a frame designed in java in Task bar, so that what ever window i am opening my frame will be visible.

    Please tell me How to do this
    Simply create a JFrame and display it; by default frames will have an icon
    visible in the task bar.

    kind regards,

    Jos

    Comment

    • SarojaKannan
      New Member
      • Aug 2007
      • 8

      #3
      Originally posted by JosAH
      Simply create a JFrame and display it; by default frames will have an icon
      visible in the task bar.

      kind regards,

      Jos
      I have to design a Progress bar in java and i have to keep the progress bar in the Task bar itself.

      Please tell me a Solution for that.

      Comment

      • Nepomuk
        Recognized Expert Specialist
        • Aug 2007
        • 3111

        #4
        Originally posted by SarojaKannan
        I have to design a Progress bar in java and i have to keep the progress bar in the Task bar itself.

        Please tell me a Solution for that.
        So, do I understand correctly: You want a new Icon or Symbolbar in the Taskbar, and this should be your progress bar? Hm, difficult one...

        If you're using jdk 1.6 or later, have a look at java.awt.SysemT ray. Here's some information and some links. I don't know about earlier versions of jdk, just have a look around. Searching Google with the words "Taskbar" "System Tray" and, of course, "java" might help.

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Originally posted by nepomuk
          So, do I understand correctly: You want a new Icon or Symbolbar in the Taskbar, and this should be your progress bar? Hm, difficult one...

          If you're using jdk 1.6 or later, have a look at java.awt.SysemT ray. Here's some information and some links. I don't know about earlier versions of jdk, just have a look around. Searching Google with the words "Taskbar" "System Tray" and, of course, "java" might help.
          That SystemTray implementation is severly broken; when it was in its prototype
          stage Sun promised/suggested that Swing components could be used to populate
          the darn thing. For their final version they reverted to simple AWT components
          instead. A progress bar is a JComponent (Swing) which can't be properly handled
          by that silly system tray.

          kind regards,

          Jos

          Comment

          • SarojaKannan
            New Member
            • Aug 2007
            • 8

            #6
            Please Tell me is there any other way to do that

            Comment

            • JosAH
              Recognized Expert MVP
              • Mar 2007
              • 11453

              #7
              Originally posted by SarojaKannan
              Please Tell me is there any other way to do that
              Having a progress bar in the system tray or taskbar is nearly impossible unless
              you design a couple of images (icons) which you can use to make it *look* like
              a progressbar. But it I were you, I'd forget about it because people would find
              it strange looking and it's not conforming to any GUI style guide.

              kind regards,

              Jos

              Comment

              • praveen2gupta
                New Member
                • May 2007
                • 200

                #8
                Originally posted by SarojaKannan
                I want to keep a frame designed in java in Task bar, so that what ever window i am opening my frame will be visible.

                Please tell me How to do this
                see following code for understanding basic concept only
                Code:
                import javax.swing.*;
                
                public class JFrame01 extends JFrame {
                	public static void main(String args[]) 	{
                		JLabel emptyLabel = new JLabel("  ");
                
                			 // Step01    Create a object of Frame class
                		JFrame frame = new JFrame(" JFrame ");
                
                			// Step 02   when the frame is closes
                		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                
                			// Step 03  Create components and put them in the frame.
                		frame.getContentPane().add(emptyLabel);
                
                			// Step 04. Size the frame.
                		frame.pack();
                
                			// Step 05. Show it.
                		frame.setVisible(true);
                	}
                }

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Originally posted by praveen2gupta
                  see following code for understanding basic concept only
                  Code:
                  import javax.swing.*;
                  
                  public class JFrame01 extends JFrame {
                  	public static void main(String args[]) 	{
                  		JLabel emptyLabel = new JLabel("  ");
                  
                  			 // Step01    Create a object of Frame class
                  		JFrame frame = new JFrame(" JFrame ");
                  
                  			// Step 02   when the frame is closes
                  		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  
                  			// Step 03  Create components and put them in the frame.
                  		frame.getContentPane().add(emptyLabel);
                  
                  			// Step 04. Size the frame.
                  		frame.pack();
                  
                  			// Step 05. Show it.
                  		frame.setVisible(true);
                  	}
                  }
                  That doesn't make sense: why *has* your JFrame another JFrame? That is not
                  an applicable example.

                  kind regards,

                  Jos

                  Comment

                  • r035198x
                    MVP
                    • Sep 2006
                    • 13225

                    #10
                    Originally posted by praveen2gupta
                    see following code for understanding basic concept only
                    Code:
                    import javax.swing.*;
                    
                    public class JFrame01 extends JFrame {
                    	public static void main(String args[]) 	{
                    		JLabel emptyLabel = new JLabel("  ");
                    
                    			 // Step01    Create a object of Frame class
                    		JFrame frame = new JFrame(" JFrame ");
                    
                    			// Step 02   when the frame is closes
                    		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    
                    			// Step 03  Create components and put them in the frame.
                    		frame.getContentPane().add(emptyLabel);
                    
                    			// Step 04. Size the frame.
                    		frame.pack();
                    
                    			// Step 05. Show it.
                    		frame.setVisible(true);
                    	}
                    }
                    And what has this to do with adding a progress bar on the system tray?

                    Comment

                    Working...