-
Bug
-
Resolution: Unresolved
-
P3
-
8, 9
-
Linux Ubuntu: 14.04
Gnome: 3.9.90
JDK 1.8.0_40-ea
-
linux
Steps to reproduce:
Run the code:
-----------------------
import javax.swing.*;
import com.sun.java.swing.plaf.gtk.GTKLookAndFeel;
public class GnomeHiDPITest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
try {
UIManager.setLookAndFeel(new GTKLookAndFeel());
JFrame frame = new JFrame();
frame.setSize(100, 100);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JMenuBar menuBar = new JMenuBar();
menuBar.add(new JMenu("Test 1"));
menuBar.add(new JMenu("Test 2"));
frame.setJMenuBar(menuBar);
frame.setVisible(true);
} catch (UnsupportedLookAndFeelException ex) {
throw new RuntimeException(ex);
}
});
}
}
-----------------------
- Enable HiDPI
> gsettings set org.gnome.desktop.interface scaling-factor 2
The text menu size is enlarged.
Note that under Metal L&F the text size is not changed.
Run the code:
-----------------------
import javax.swing.*;
import com.sun.java.swing.plaf.gtk.GTKLookAndFeel;
public class GnomeHiDPITest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
try {
UIManager.setLookAndFeel(new GTKLookAndFeel());
JFrame frame = new JFrame();
frame.setSize(100, 100);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JMenuBar menuBar = new JMenuBar();
menuBar.add(new JMenu("Test 1"));
menuBar.add(new JMenu("Test 2"));
frame.setJMenuBar(menuBar);
frame.setVisible(true);
} catch (UnsupportedLookAndFeelException ex) {
throw new RuntimeException(ex);
}
});
}
}
-----------------------
- Enable HiDPI
> gsettings set org.gnome.desktop.interface scaling-factor 2
The text menu size is enlarged.
Note that under Metal L&F the text size is not changed.
- duplicates
-
JDK-8143406 HiDPI: should AWT components be harmonized with Swing (taking into account scale factor somehow)?
- Closed
-
JDK-8159465 [hidpi] java/awt/font/FontScaling/FontScalingTest.java fails on Ubuntu 16 + HiDPI
- Closed
- relates to
-
JDK-8149115 [hidpi] Linux: display-wise scaling factor should probably be taken into account
- Resolved
-
JDK-8137571 Linux HiDPI Graphics support
- Resolved