package com.product.device.test; import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Image; import java.awt.Toolkit; import java.util.HashMap; import java.util.Map; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.WindowConstants; public class DeviceDataGatherTest extends JFrame { JPanel current = null; // 得到显示器屏幕的宽高 public int width = Toolkit.getDefaultToolkit().getScreenSize().width; public int height = Toolkit.getDefaultToolkit().getScreenSize().height - 40; // 定义窗体的宽高 public int windowsWedth = 1500; public int windowsHeight = 700; private Map panel = new HashMap(); DeviceGatherPanel mp = new DeviceGatherPanel(this); public JPanel getPanel(String name) { return panel.get(name); } public void setPanel(String name, JPanel panel) { this.panel.put(name, panel); } JPanel mpanel = new JPanel(new BorderLayout()); public JPanel getMpanel() { return mpanel; } public void setMpanel(JPanel mpanel) { this.mpanel = mpanel; } public DeviceDataGatherTest() { this.setTitle("设备管理数据采集测试"); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); // 设置窗体位置和大小 this.setBounds((width - windowsWedth) / 2, (height - windowsHeight) / 2, windowsWedth, windowsHeight); try { this.setContentPane(mp); this.setResizable(false); this.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } public static void main(String args[]) { DeviceDataGatherTest master = new DeviceDataGatherTest(); } }