use of com.sun.java.swing.plaf.windows.WindowsInternalFrameUI in project java-swing-tips by aterai.
the class DesktopLayerUI method createFrame2.
private static JInternalFrame createFrame2() {
JInternalFrame f = new JInternalFrame("WindowsInternalFrameUI", true, true, true, true) {
@Override
public void updateUI() {
super.updateUI();
setUI(new WindowsInternalFrameUI(this) {
@Override
protected MouseInputAdapter createBorderListener(JInternalFrame w) {
return new BorderListener() {
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
super.mouseClicked(e);
}
}
@Override
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
super.mousePressed(e);
}
}
};
}
});
}
};
f.setSize(200, 100);
f.setLocation(5 + 40, 5 + 50);
EventQueue.invokeLater(() -> f.setVisible(true));
return f;
}
Aggregations