当我使用从 Linux RHEL 7.3 到Windows 8.1 / 10的X11转发时,会出现GUI问题。不显示AWT标签,按钮,菜单。当 Linux RHEL 6.8 或/和SWING使用时,没有问题。 Linux RHEL 7.3 可能有什么问题?
AWTDemo.java:
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class AWTDemo extends Frame
{
AWTDemo()
{
setTitle("AWT Demo");
setBounds(200,200, 200, 100);
Button b=new Button("BUTTON");
b.setBounds(50,100,50,50);
add(b, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent we) {dispose();}});
setVisible(true);
}
public static void main(String args[])
{
AWTDemo wnd = new AWTDemo();
}
}
SWINGDemo.java:
import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
public class SWINGDemo extends JFrame
{
SWINGDemo()
{
super("SWING Demo");
setBounds(200,200, 200, 100);
JButton b = new JButton("BUTTON");
add(b, BorderLayout.SOUTH);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args)
{
SWINGDemo wnd = new SWINGDemo();
}
}