Skip to content

Commit 2f41f6a

Browse files
committed
explain error occured.
1 parent 1ef3092 commit 2f41f6a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tda/src/main/java/de/grimmfrost/tda/utils/StatusBar.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class StatusBar extends JPanel {
4242
private JLabel infoLabel = null;
4343
private JProgressBar memStatus = null;
4444
private JLabel errorLabel = null;
45+
private JLabel errorLabelText = null;
4546
private static StatusBar instance = null;
4647

4748
/**
@@ -57,9 +58,14 @@ public StatusBar(boolean showMemory) {
5758

5859
errorLabel = new JLabel(new RedDotIcon());
5960
errorLabel.setVisible(false);
60-
errorLabel.setToolTipText("An error has occurred. Please check the logfile.");
61+
errorLabel.setToolTipText("An error has occurred. Please check the logfile (see README on GitHub for details).");
6162
rightPanel.add(errorLabel);
6263

64+
errorLabelText = new JLabel("Error occurred!");
65+
errorLabelText.setToolTipText("An error has occurred. Please check the logfile (see README on GitHub for details).");
66+
errorLabelText.setVisible(false);
67+
rightPanel.add(errorLabelText);
68+
6369
rightPanel.add(createMemoryStatus());
6470

6571
JPanel iconPanel = new JPanel(new BorderLayout());
@@ -85,6 +91,7 @@ public static StatusBar getInstance() {
8591
public void showErrorIndicator() {
8692
if (errorLabel != null) {
8793
errorLabel.setVisible(true);
94+
errorLabelText.setVisible(true);
8895
}
8996
}
9097

@@ -162,7 +169,7 @@ public MemoryStatusUpdater(JProgressBar memStatus) {
162169
public void run() {
163170
try {
164171
while(true) {
165-
double factor = (int) rt.totalMemory() / 100;
172+
double factor = (double) (int) rt.totalMemory() / 100;
166173
int perc = (int) ((rt.totalMemory() - rt.freeMemory()) / factor);
167174
memStatus.setValue(perc);
168175
double usedMem = (rt.totalMemory() - rt.freeMemory()) / 1024.0 / 1024.0;

0 commit comments

Comments
 (0)