| | |
| | | package com.example.client; |
| | | |
| | | import com.example.client.service.*; |
| | | import com.example.server.utils.NumToDate; |
| | | import com.teamdev.jxbrowser.chromium.*; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class Main extends JFrame implements MouseListener { |
| | | @Autowired |
| | | private SetUIFontService setUIFontService; |
| | | @Autowired |
| | | private NumToDate numToDate; |
| | | @Autowired |
| | | private MenuService treeServise; |
| | | private final JPopupMenu menu = new JPopupMenu(); |
| | |
| | | } |
| | | |
| | | public void Start(Integer role, Long userId) throws HeadlessException { |
| | | final java.util.concurrent.ExecutorService executor = java.util.concurrent.Executors.newSingleThreadExecutor(r -> { |
| | | Thread t = new Thread(r, "numToDate-thread"); |
| | | t.setDaemon(true); |
| | | return t; |
| | | }); |
| | | executor.submit(() -> { |
| | | try { |
| | | numToDate.numDate(); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } finally { |
| | | executor.shutdown(); |
| | | } |
| | | }); |
| | | //获取屏幕宽高 |
| | | GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
| | | Rectangle rect = ge.getMaximumWindowBounds(); |
| | |
| | | hSplitPane.setDividerSize(10); |
| | | hSplitPane.setOneTouchExpandable(true); |
| | | hSplitPane.setContinuousLayout(true); |
| | | |
| | | frame.getContentPane().add(hSplitPane, BorderLayout.CENTER); |
| | | |
| | | JSplitPane vSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
| | |
| | | tabbedPane.addTab(title, panel); |
| | | Component tabComponent = createTabComponent(title, tree); |
| | | tabbedPane.setTabComponentAt(tabbedPane.getTabCount() - 1, tabComponent);// 设置自定义标签组件//切换到当前页面 |
| | | if (tabbedPane.getTabCount() > 5) { |
| | | // 删除第一个标签 |
| | | tabbedPane.removeTabAt(0); |
| | | } |
| | | tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1); |
| | | } |
| | | |