我想使用#jxmaps 提取 GPS 坐标。为此,我添加了两个 JPanel。一个面板可以容纳几个按钮和文本字段,而在另一个面板中我想添加 MapView。我试过这个
JPanel mypanel = new JPanel();//null;
JPanel mypanel2 = new JPanel();
mypanel.setLayout(new BorderLayout(200,100));
mypanel.setVisible(true);
mypanel.add(mapView, BorderLayout.CENTER);
JFrame frame = new JFrame("JxMaps - Hello, World!");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.add(mypanel, BorderLayout.CENTER);
frame.add(mypanel2, BorderLayout.EAST);
frame.setSize(700, 500);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
但它不起作用。谁能指导我如何做到这一点?
问候阿米尔