no message
This commit is contained in:
15
src/_VisualDVM/Visual/Controls/ShortLabel.java
Normal file
15
src/_VisualDVM/Visual/Controls/ShortLabel.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package _VisualDVM.Visual.Controls;
|
||||
import javax.swing.*;
|
||||
public class ShortLabel extends JLabel {
|
||||
int max = 0;
|
||||
public ShortLabel(int max_in) {
|
||||
max = max_in;
|
||||
}
|
||||
@Override
|
||||
public void setText(String text_in) {
|
||||
if ((max > 0) && (text_in.length() > max)) {
|
||||
super.setText(text_in.substring(0, max - 1) + "...");
|
||||
} else super.setText(text_in);
|
||||
setToolTipText(text_in);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user