Java Code Examples for org.jdesktop.swingx.JXBusyLabel#setBusy()

The following examples show how to use org.jdesktop.swingx.JXBusyLabel#setBusy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PanelBusy.java    From BART with MIT License 6 votes vote down vote up
public PanelBusy() {
    setLayout(new BorderLayout(196, 0));      
    setPreferredSize(new Dimension(589,250));
    logo = ImageUtilities.loadImage(R.IMAGE_LOGO);
    busyLabel = new JXBusyLabel(new Dimension(50, 50)); 
    busyLabel.setName("busyLabel"); 
    busyLabel.getBusyPainter().setHighlightColor(new Color(44, 61, 146).darker()); 
    busyLabel.getBusyPainter().setBaseColor(new Color(168, 204, 241).brighter()); 
    busyLabel.setBusy(true); 
    busyLabel.setDelay(40);
    busyLabel.getBusyPainter().setPoints(18);
    busyLabel.getBusyPainter().setTrailLength(5);
    add(new JLabel(),BorderLayout.WEST);
    add(new JLabel(),BorderLayout.EAST);
    add(busyLabel,BorderLayout.CENTER);
}
 
Example 2
Source File: FlatBusyLabelUI.java    From FlatLaf with Apache License 2.0 5 votes vote down vote up
@Override
protected void installDefaults( JLabel c ) {
	super.installDefaults( c );

	disabledForeground = UIManager.getColor( "Label.disabledForeground" );

	// force recreation of busy painter for correct colors when switching LaF
	if( c.getIcon() != null ) {
		JXBusyLabel busyLabel = (JXBusyLabel) c;
		boolean oldBusy = busyLabel.isBusy();
		busyLabel.setBusy( false );
		busyLabel.setBusyPainter( null );
		busyLabel.setBusy( oldBusy );
	}
}
 
Example 3
Source File: BusyDialog.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
private void init() {
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    busyLabel = new JXBusyLabel();

    busyLabel.setText(getTitle());
    busyLabel.setBusy(true);

    add(busyLabel);
    pack();
    setSize(new Dimension(300, getBounds().height));
    setLocationRelativeTo(this);
    setResizable(false);
}
 
Example 4
Source File: LoadingContainer.java    From 07kit with GNU General Public License v3.0 5 votes vote down vote up
public LoadingContainer() {
    setBackground(Application.COLOUR_SCHEME.getDark().brighter());
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    getInsets().set(0, 10, 10, 10);


    setLayout(new GridBagLayout());
    JXBusyLabel loadingSpinner = new JXBusyLabel(new Dimension(38, 38));
    BusyPainter painter = new BusyPainter(
            new Rectangle2D.Float(0, 0, 8.0f, 8.0f),
            new Rectangle2D.Float(5.5f, 5.5f, 27.0f, 27.0f));
    painter.setTrailLength(4);
    painter.setPoints(8);
    painter.setFrame(-1);
    painter.setBaseColor(Application.COLOUR_SCHEME.getLight());
    painter.setHighlightColor(Color.WHITE);
    loadingSpinner.setBusyPainter(painter);
    loadingSpinner.setVisible(true);
    loadingSpinner.setBusy(true);

    add(loadingSpinner);
    GridBagConstraints c = new GridBagConstraints();

    loadingLabel = new JLabel("Loading..");
    loadingLabel.setForeground(Color.WHITE);
    loadingLabel.setFont(loadingLabel.getFont().deriveFont(16f).deriveFont(Font.BOLD));
    add(loadingLabel);

    c.fill = GridBagConstraints.VERTICAL;
    c.gridx = 0;
    c.gridy = 2;
    c.insets = new Insets(6, 6, 6, 6);
    add(loadingLabel, c);
}
 
Example 5
Source File: LoadingFrame.java    From 07kit with GNU General Public License v3.0 4 votes vote down vote up
public LoadingFrame() {
	setTitle("07Kit");
	setSize(320, 130);
	setResizable(false);
	getContentPane().setBackground(DARK);
	setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

	setLayout(new GridBagLayout());
	JXBusyLabel loadingSpinner = new JXBusyLabel(new Dimension(38, 38));
	BusyPainter painter = new BusyPainter(
			new Rectangle2D.Float(0, 0, 8.0f, 8.0f),
			new Rectangle2D.Float(5.5f, 5.5f, 27.0f, 27.0f));
	painter.setTrailLength(4);
	painter.setPoints(8);
	painter.setFrame(-1);
	painter.setBaseColor(LIGHT);
	painter.setHighlightColor(Color.WHITE);
	loadingSpinner.setBusyPainter(painter);
	loadingSpinner.setVisible(true);
	loadingSpinner.setBusy(true);

	add(loadingSpinner);
	GridBagConstraints c = new GridBagConstraints();

	loadingLabel = new JLabel("Loading..");
	loadingLabel.setForeground(Color.WHITE);
	loadingLabel.setFont(loadingLabel.getFont().deriveFont(16f).deriveFont(Font.BOLD));
	add(loadingLabel);

	c.fill = GridBagConstraints.VERTICAL;
	c.gridx = 0;
	c.gridy = 2;
	c.insets = new Insets(6, 6, 6, 6);
	add(loadingLabel, c);

	Toolkit toolkit = Toolkit.getDefaultToolkit();
	int centerX = (toolkit.getScreenSize().width / 2) - (getWidth() / 2);
	int centerY = (toolkit.getScreenSize().height / 2) - (getHeight() / 2);
	setLocation(centerX, centerY);
	setVisible(true);
}