Skip to content

Commit

Permalink
adding tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Nlk29 committed Sep 8, 2023
1 parent 11c3b01 commit 2877b38
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/org/ScreenDoc/ConfigScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;


@SuppressWarnings("serial")
Expand Down Expand Up @@ -152,6 +154,17 @@ void DrawMainMenu()
monitorQualityTestButton.setText("Test Monitor Quality");
monitorQualityTestButton.addActionListener(this);
monitorQualityTestButton.setActionCommand("monitorTest");
monitorQualityTestButton.setToolTipText("Not available yet.");
monitorQualityTestButton.addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(ComponentEvent e) {
if (!monitorQualityTestButton.isEnabled()) {
monitorQualityTestButton.setToolTipText("disabled");
} else {
monitorQualityTestButton.setToolTipText(null); // Clear the tooltip when enabled
}
}
});
monitorQualityTestButton.setEnabled(monitorQualityTestEnable);
panel.add(monitorQualityTestButton);

Expand Down

0 comments on commit 2877b38

Please sign in to comment.