public AppMainFrame() { initGlobalFontSetting(new Font("微软雅黑", Font.PLAIN, 12)); JPanel mainPanel = new JPanel(new VerticalFlowLayout()); mainPanel.setPreferredSize(new Dimension(WIN_WIDTH, WIN_HEIGHT)); textArea = new XMLRSyntaxTextArea(30, 70); RTextScrollPane sp = new RTextScrollPane(textArea); textArea.setDropCallBack(dropInterface); JPanel packagePanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP)); packagePanel.setPreferredSize(new Dimension(WIN_WIDTH, 150)); packagePanel.setBorder(BorderFactory.createTitledBorder("拖动apk或者ipa到文本区域")); JPanel namePanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); nameLabel = new JLabel("软件名称"); name_text = new JLabel(""); namePanel.add(nameLabel); namePanel.add(name_text); JPanel versionPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); versionLabel = new JLabel("versionStr:"); version_text = new JLabel(""); versionPanel.add(versionLabel); versionPanel.add(version_text); JPanel versionCodePanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); versionCodeLabel = new JLabel("versionCode:"); versionCode_text = new JLabel(""); versionCodePanel.add(versionCodeLabel); versionCodePanel.add(versionCode_text); packagePanel.add(namePanel); packagePanel.add(versionPanel); packagePanel.add(versionCodePanel); mainPanel.add(packagePanel); mainPanel.add(sp); setContentPane(mainPanel); setDefaultCloseOperation(EXIT_ON_CLOSE); pack(); setLocationRelativeTo(null); }
public AppMainFrame(String zipFile, String findFile, boolean regexp) { this(); String info = FileUtil.getFileData(zipFile, findFile, regexp); textArea.setText(info); }