Package voxo.client.views.components

Source Code of voxo.client.views.components.CustomWait

package voxo.client.views.components;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GraphicsEnvironment;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;

@SuppressWarnings("serial")
public class CustomWait extends JFrame{

  public CustomWait(String name) {
    GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
   
    try{
         UIManager.setLookAndFeel(
              UIManager.getSystemLookAndFeelClassName());
      }
      catch(Exception ex){
      }

    JLabel j = new JLabel("Waiting for " + name);
    j.setIcon( new ImageIcon("resources/images/ajax-loader.gif"));
    j.setBackground(Color.LIGHT_GRAY);
    j.setHorizontalAlignment(SwingConstants.CENTER);
    setResizable(false);
    setAlwaysOnTop(true);
    setLocation(((e.getMaximumWindowBounds().width-200+e.getMaximumWindowBounds().x)/2), ((e.getMaximumWindowBounds().height-70+e.getMaximumWindowBounds().y)/2));
    setSize(new Dimension(200, 80));
   
    this.add(j);
  }

 
}
TOP

Related Classes of voxo.client.views.components.CustomWait

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.