forked from chromiumembedded/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStatusPanel.java
More file actions
48 lines (38 loc) · 1.47 KB
/
StatusPanel.java
File metadata and controls
48 lines (38 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
package tests.detailed.ui;
import java.awt.Dimension;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
@SuppressWarnings("serial")
public class StatusPanel extends JPanel {
private final JProgressBar progressBar_;
private final JLabel status_field_;
public StatusPanel() {
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
add(Box.createHorizontalStrut(5));
add(Box.createHorizontalStrut(5));
progressBar_ = new JProgressBar();
Dimension progressBarSize = progressBar_.getMaximumSize();
progressBarSize.width = 100;
progressBar_.setMinimumSize(progressBarSize);
progressBar_.setMaximumSize(progressBarSize);
add(progressBar_);
add(Box.createHorizontalStrut(5));
status_field_ = new JLabel("Info");
status_field_.setAlignmentX(LEFT_ALIGNMENT);
add(status_field_);
add(Box.createHorizontalStrut(5));
add(Box.createVerticalStrut(21));
}
public void setIsInProgress(boolean inProgress) {
progressBar_.setIndeterminate(inProgress);
}
public void setStatusText(String text) {
status_field_.setText(text);
}
}