List of usage examples for javax.swing JScrollPane setBounds
public void setBounds(int x, int y, int width, int height)
From source file:Main.java
public static void main(String[] args) { JFrame frame = new JFrame(); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(10, 11, 212, 500); frame.getContentPane().add(scrollPane); JTree tree = new JTree(addNodes(new File("."))); tree.setRootVisible(false);//from ww w . j ava2 s . c o m tree.setShowsRootHandles(true); tree.setBorder(new LineBorder(new Color(0, 0, 0))); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); scrollPane.setViewportView(tree); tree.setCellRenderer(new FileTreeCellRenderer()); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); }
From source file:Main.java
private void loadLabel() { label.setBounds(0, 0, 269, 20);//w w w . j a v a 2 s. co m panel.add(label); input.setBounds(0, 20, 300, 60); JScrollPane scroll = new JScrollPane(input); scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); scroll.setVisible(true); scroll.setBounds(50, 20, 300, 60); panel.add(scroll); }
From source file:dpcs.AppPackagesList.java
@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" }) public AppPackagesList() { setResizable(false);//from w ww .j av a 2s .c om setTitle("App Packages List"); setIconImage(Toolkit.getDefaultToolkit().getImage(AppPackagesList.class.getResource("/graphics/Icon.png"))); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 479, 451); contentPane = new JPanel(); contentPane.setBackground(Color.WHITE); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(22, 12, 428, 333); contentPane.add(scrollPane); JButton btnRefresh = new JButton("Refresh"); btnRefresh.setToolTipText("Refresh the apps list"); btnRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { Process p1 = Runtime.getRuntime().exec("adb shell pm list packages > /sdcard/.allapps.txt"); p1.waitFor(); Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.allapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.allapps.txt"); p3.waitFor(); lines = IOUtils.readLines(new FileInputStream(".allapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); moddedvalues = new String[values.length]; for (int i = 0; i < values.length; i++) { moddedvalues[i] = values[i].substring(8); } applist = new JList(); applist.setModel(new AbstractListModel() { public int getSize() { return moddedvalues.length; } public Object getElementAt(int index) { return moddedvalues[index]; } }); scrollPane.setViewportView(applist); File file = new File(".allapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } } catch (Exception e1) { System.err.println(e1); } } }); btnRefresh.setBounds(125, 357, 220, 47); contentPane.add(btnRefresh); try { Process p1 = Runtime.getRuntime().exec("adb shell pm list packages > /sdcard/.allapps.txt"); p1.waitFor(); Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.allapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.allapps.txt"); p3.waitFor(); lines = IOUtils.readLines(new FileInputStream(".allapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); moddedvalues = new String[values.length]; for (int i = 0; i < values.length; i++) { moddedvalues[i] = values[i].substring(8); } applist = new JList(); applist.setModel(new AbstractListModel() { public int getSize() { return moddedvalues.length; } public Object getElementAt(int index) { return moddedvalues[index]; } }); scrollPane.setViewportView(applist); File file = new File(".allapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } } catch (Exception e1) { System.err.println(e1); } }
From source file:com.ln.gui.Notifylist.java
@SuppressWarnings("unchecked") public Notifylist() { setDefaultCloseOperation(DISPOSE_ON_CLOSE); setResizable(false);/* w w w . jav a 2s .co m*/ setIconImage(Toolkit.getDefaultToolkit().getImage(Configuration.mydir + "\\resources\\icons\\ln6464.png")); setTitle("Event list"); DateFormat dd = new SimpleDateFormat("dd"); DateFormat dh = new SimpleDateFormat("HH"); DateFormat dm = new SimpleDateFormat("mm"); Date day = new Date(); Date hour = new Date(); Date minute = new Date(); int dayd = Integer.parseInt(dd.format(day)); int hourh = Integer.parseInt(dh.format(hour)); int minutem = Integer.parseInt(dm.format(minute)); int daydiff = dayd - Main.dayd; int hourdiff = hourh - Main.hourh; int mindiff = minutem - Main.minutem; model.clear(); Events = new String[Main.events]; Events2 = new String[Main.events]; // Events = Main.Eventlist; for (int i = 0; i != Main.events; i++) { Events[i] = Main.Eventlist[i]; } for (int i = 0; i != Main.events; i++) { Events2[i] = Main.Eventlist[i]; } for (int i = 0; i != Events2.length; i++) { if (Events2[i] != null) { Events2[i] = Main.Eventlist[i]; Events2[i] = Events2[i].replace(StringUtils.substringBetween(Events2[i], "in: ", " Days"), Integer .toString(Integer.parseInt(StringUtils.substringBetween(Events2[i], "in: ", " Days")))); Events2[i] = Events2[i].replace(StringUtils.substringBetween(Events2[i], "Days ", " Hours"), Integer .toString(Integer.parseInt(StringUtils.substringBetween(Events2[i], "Days ", " Hours")))); Events2[i] = Events2[i].replace(StringUtils.substringBetween(Events2[i], "Hours ", " Minutes"), Integer.toString( Integer.parseInt(StringUtils.substringBetween(Events2[i], "Hours ", " Minutes")))); } if (Events[i] != null) { Events[i] = Main.Eventlist[i]; Events[i] = Events[i].replace(StringUtils.substringBetween(Events[i], "in: ", " Days"), Integer.toString(Integer.parseInt(StringUtils.substringBetween(Events[i], "in: ", " Days")) - daydiff)); Events[i] = Events[i].replace(StringUtils.substringBetween(Events[i], "Days ", " Hours"), Integer.toString( Integer.parseInt(StringUtils.substringBetween(Events[i], "Days ", " Hours")) - hourdiff)); Events[i] = Events[i].replace(StringUtils.substringBetween(Events[i], "Hours ", " Minutes"), Integer.toString( Integer.parseInt(StringUtils.substringBetween(Events[i], "Hours ", " Minutes")) - mindiff)); //Arrays.sort(Events); model.add(i, Events[i]); } } setBounds(100, 100, 671, 331); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JButton Remove = new JButton("Remove selected"); Remove.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (list.getSelectedIndices().length > 0) { int[] tmp = list.getSelectedIndices(); Main.events = Main.events - tmp.length; int[] selectedIndices = list.getSelectedIndices(); for (int i = tmp.length - 1; i >= 0; i--) { selectedIndices = list.getSelectedIndices(); model.removeElementAt(selectedIndices[i]); Events = ArrayUtils.remove(Events, selectedIndices[i]); Events2 = ArrayUtils.remove(Events2, selectedIndices[i]); Main.Eventlist = ArrayUtils.remove(Main.Eventlist, selectedIndices[i]); //http://i.imgur.com/lN2Fe.jpg } } } }); Remove.setBounds(382, 258, 130, 25); contentPane.add(Remove); JButton btnClose = new JButton("Close"); btnClose.setBounds(522, 258, 130, 25); contentPane.add(btnClose); btnClose.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); } }); try { JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(10, 11, 642, 236); contentPane.add(scrollPane); list.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null)); list.setBounds(10, 11, 642, 46); scrollPane.setViewportView(list); scrollPane.getVerticalScrollBar().setValue(0); } catch (NullPointerException e) { } }
From source file:edu.smc.mediacommons.panels.SecurityPanel.java
public SecurityPanel() { setLayout(null);/*www . ja v a 2s.c o m*/ FILE_CHOOSER = new JFileChooser(); JButton openFile = Utils.createButton("Open File", 10, 20, 100, 30, null); add(openFile); JButton saveFile = Utils.createButton("Save File", 110, 20, 100, 30, null); add(saveFile); JButton decrypt = Utils.createButton("Decrypt", 210, 20, 100, 30, null); add(decrypt); JButton encrypt = Utils.createButton("Encrypt", 310, 20, 100, 30, null); add(encrypt); JTextField path = Utils.createTextField(10, 30, 300, 20); path.setText("No file selected"); final JTextArea viewer = new JTextArea(); JScrollPane pastePane = new JScrollPane(viewer); pastePane.setBounds(15, 60, 400, 200); add(pastePane); openFile.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (FILE_CHOOSER.showOpenDialog(getParent()) == JFileChooser.APPROVE_OPTION) { File toRead = FILE_CHOOSER.getSelectedFile(); if (toRead == null) { JOptionPane.showMessageDialog(getParent(), "The input file does not exist!", "Opening Failed...", JOptionPane.WARNING_MESSAGE); } else { try { List<String> lines = IOUtils.readLines(new FileInputStream(toRead), "UTF-8"); viewer.setText(""); for (String line : lines) { viewer.append(line); } } catch (IOException ex) { } } } } }); saveFile.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (FILE_CHOOSER.showSaveDialog(getParent()) == JFileChooser.APPROVE_OPTION) { File toWrite = FILE_CHOOSER.getSelectedFile(); Utils.writeToFile(viewer.getText(), toWrite); JOptionPane.showMessageDialog(getParent(), "The file has now been saved to\n" + toWrite.getPath()); } } }); encrypt.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String password = Utils.getPasswordInput(getParent()); if (password != null) { try { BasicTextEncryptor basicTextEncryptor = new BasicTextEncryptor(); basicTextEncryptor.setPassword(password); String text = basicTextEncryptor.encrypt(viewer.getText()); viewer.setText(text); } catch (Exception ex) { JOptionPane.showMessageDialog(getParent(), "Could not encrypt the text, an unexpected error occurred.", "Encryption Failed...", JOptionPane.WARNING_MESSAGE); } } else { JOptionPane.showMessageDialog(getParent(), "Could not encrypt the text, as no\npassword has been specified.", "Encryption Failed...", JOptionPane.WARNING_MESSAGE); } } }); decrypt.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String password = Utils.getPasswordInput(getParent()); if (password != null) { try { BasicTextEncryptor basicTextEncryptor = new BasicTextEncryptor(); basicTextEncryptor.setPassword(password); String text = basicTextEncryptor.decrypt(viewer.getText()); viewer.setText(text); } catch (Exception ex) { JOptionPane.showMessageDialog(getParent(), "Could not decrypt the text, an unexpected error occurred.", "Decryption Failed...", JOptionPane.WARNING_MESSAGE); } } else { JOptionPane.showMessageDialog(getParent(), "Could not decrypt the text, as no\npassword has been specified.", "Decryption Failed...", JOptionPane.WARNING_MESSAGE); } } }); }
From source file:dpcs.UninstallSystemApps.java
@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" }) public UninstallSystemApps() { setResizable(false);// w w w. j ava2 s . com setTitle("Uninstall System Apps"); setIconImage( Toolkit.getDefaultToolkit().getImage(UninstallSystemApps.class.getResource("/graphics/Icon.png"))); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 482, 475); contentPane = new JPanel(); contentPane.setBackground(Color.WHITE); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel AppStatus = new JLabel(""); AppStatus.setBounds(12, 393, 456, 17); contentPane.add(AppStatus); SystemAppUninstallDone = new JLabel(""); SystemAppUninstallDone.setBounds(151, 312, 186, 56); contentPane.add(SystemAppUninstallDone); JLabel lblSelect = new JLabel("Select an app to remove"); lblSelect.setBounds(26, 12, 405, 17); contentPane.add(lblSelect); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(22, 41, 428, 259); contentPane.add(scrollPane); final JButton btnUninstall = new JButton("Uninstall"); btnUninstall.setToolTipText("Uninstall the selected app"); btnUninstall.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SystemAppUninstallDone.setText(""); if (list.getSelectedValue() == null) { JOptionPane.showMessageDialog(null, "Please select an app first"); } else { try { AppStatus.setText("Uninstalling..."); Process p1 = Runtime.getRuntime().exec("adb remount"); p1.waitFor(); String[] commands = new String[3]; commands[0] = "adb shell su -c rm -r "; commands[1] = "/system/app/"; commands[2] = " " + list.getSelectedValue(); Process p2 = Runtime.getRuntime().exec(commands, null); p2.waitFor(); Process p3 = Runtime.getRuntime() .exec("adb shell ls /system/app/ > /sdcard/.systemapps.txt"); p3.waitFor(); Process p4 = Runtime.getRuntime().exec("adb pull /sdcard/.systemapps.txt"); p4.waitFor(); Process p5 = Runtime.getRuntime().exec("adb shell rm /sdcard/.systemapps.txt"); p5.waitFor(); lines = IOUtils.readLines(new FileInputStream(".systemapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return values.length; } public Object getElementAt(int index) { return values[index]; } }); scrollPane.setViewportView(list); File file = new File(".systemapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } AppStatus.setText("App has been uninstalled successfully"); SystemAppUninstallDone .setIcon(new ImageIcon(Interface.class.getResource("/graphics/Smalldone.png"))); btnUninstall.setSelected(false); } catch (Exception e1) { System.err.println(e1); } } } }); btnUninstall.setBounds(26, 327, 107, 27); contentPane.add(btnUninstall); JButton btnRefresh = new JButton("Refresh"); btnRefresh.setToolTipText("Refresh the apps list"); btnRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { Process p1 = Runtime.getRuntime().exec("adb shell ls /system/app/ > /sdcard/.systemapps.txt"); p1.waitFor(); Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.systemapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.systemapps.txt"); p3.waitFor(); lines = IOUtils.readLines(new FileInputStream(".systemapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return values.length; } public Object getElementAt(int index) { return values[index]; } }); scrollPane.setViewportView(list); File file = new File(".systemapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } } catch (Exception e1) { System.err.println(e1); } } }); btnRefresh.setBounds(344, 327, 107, 27); contentPane.add(btnRefresh); try { Process p1 = Runtime.getRuntime().exec("adb shell ls /system/app/ > /sdcard/.systemapps.txt"); p1.waitFor(); Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.systemapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.systemapps.txt"); p3.waitFor(); lines = IOUtils.readLines(new FileInputStream(".systemapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return values.length; } public Object getElementAt(int index) { return values[index]; } }); scrollPane.setViewportView(list); JLabel lblNewLabel = new JLabel("Note: You should also remove app's odex file if it exists"); lblNewLabel.setBounds(25, 374, 438, 17); contentPane.add(lblNewLabel); JLabel label = new JLabel("Needs root and does not work on production android builds!"); label.setBounds(25, 413, 454, 17); contentPane.add(label); File file = new File(".systemapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } } catch (Exception e) { System.err.println(e); } }
From source file:dpcs.UninstallUserApps.java
@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" }) public UninstallUserApps() { setResizable(false);/*from w w w . j av a 2 s . c om*/ setTitle("Uninstall User Apps"); setIconImage( Toolkit.getDefaultToolkit().getImage(UninstallSystemApps.class.getResource("/graphics/Icon.png"))); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 482, 430); contentPane = new JPanel(); contentPane.setBackground(Color.WHITE); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel AppStatus = new JLabel(""); AppStatus.setBounds(12, 366, 456, 17); contentPane.add(AppStatus); UserAppUninstallDone = new JLabel(""); UserAppUninstallDone.setText(""); UserAppUninstallDone.setBounds(151, 312, 186, 56); contentPane.add(UserAppUninstallDone); JLabel lblSelect = new JLabel("Select an app to remove"); lblSelect.setBounds(26, 12, 405, 17); contentPane.add(lblSelect); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(22, 41, 428, 259); contentPane.add(scrollPane); final JButton btnUninstall = new JButton("Uninstall"); btnUninstall.setToolTipText("Uninstall the selected app"); btnUninstall.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UserAppUninstallDone.setText(""); if (list.getSelectedValue() == null) { JOptionPane.showMessageDialog(null, "Please select an app first"); } else { try { AppStatus.setText("Uninstalling..."); String[] commands = new String[3]; commands[0] = "adb"; commands[1] = "uninstall"; commands[2] = "" + list.getSelectedValue(); Process p1 = Runtime.getRuntime().exec(commands, null); p1.waitFor(); Process p2 = Runtime.getRuntime() .exec("adb shell pm list packages -3 > /sdcard/.userapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb pull /sdcard/.userapps.txt"); p3.waitFor(); Process p4 = Runtime.getRuntime().exec("adb shell rm /sdcard/.userapps.txt"); p4.waitFor(); lines = IOUtils.readLines(new FileInputStream(".userapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); moddedvalues = new String[values.length]; for (int i = 0; i < values.length; i++) { moddedvalues[i] = values[i].substring(8); } list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return moddedvalues.length; } public Object getElementAt(int index) { return moddedvalues[index]; } }); scrollPane.setViewportView(list); File file = new File(".userapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } AppStatus.setText("App has been uninstalled successfully"); UserAppUninstallDone .setIcon(new ImageIcon(Interface.class.getResource("/graphics/Smalldone.png"))); btnUninstall.setSelected(false); } catch (Exception e1) { System.err.println(e1); } } } }); btnUninstall.setBounds(26, 327, 107, 27); contentPane.add(btnUninstall); JButton btnRefresh = new JButton("Refresh"); btnRefresh.setToolTipText("Refresh the apps list"); btnRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { Process p1 = Runtime.getRuntime().exec("adb shell pm list packages -3 > /sdcard/.userapps.txt"); p1.waitFor(); Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.userapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.userapps.txt"); p3.waitFor(); lines = IOUtils.readLines(new FileInputStream(".userapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); moddedvalues = new String[values.length]; for (int i = 0; i < values.length; i++) { moddedvalues[i] = values[i].substring(8); } list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return moddedvalues.length; } public Object getElementAt(int index) { return moddedvalues[index]; } }); scrollPane.setViewportView(list); File file = new File(".userapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } } catch (Exception e1) { System.err.println(e1); } } }); btnRefresh.setBounds(344, 327, 107, 27); contentPane.add(btnRefresh); try { Process p1 = Runtime.getRuntime().exec("adb shell pm list packages -3 > /sdcard/.userapps.txt"); p1.waitFor(); Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.userapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.userapps.txt"); p3.waitFor(); lines = IOUtils.readLines(new FileInputStream(".userapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); moddedvalues = new String[values.length]; for (int i = 0; i < values.length; i++) { moddedvalues[i] = values[i].substring(8); } list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return moddedvalues.length; } public Object getElementAt(int index) { return moddedvalues[index]; } }); scrollPane.setViewportView(list); File file = new File(".userapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } } catch (Exception e1) { System.err.println(e1); } }
From source file:dpcs.UninstallPrivApps.java
@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" }) public UninstallPrivApps() { setResizable(false);// ww w . jav a 2 s . co m setTitle("Uninstall Priv-apps"); setIconImage( Toolkit.getDefaultToolkit().getImage(UninstallSystemApps.class.getResource("/graphics/Icon.png"))); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 482, 500); contentPane = new JPanel(); contentPane.setBackground(Color.WHITE); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel AppStatus = new JLabel(""); AppStatus.setBounds(8, 404, 456, 17); contentPane.add(AppStatus); PrivAppUninstallDone = new JLabel(""); PrivAppUninstallDone.setText(""); PrivAppUninstallDone.setBounds(151, 312, 186, 56); contentPane.add(PrivAppUninstallDone); JLabel lblSelect = new JLabel("Select an app to remove"); lblSelect.setBounds(25, 12, 405, 17); contentPane.add(lblSelect); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(22, 41, 428, 259); contentPane.add(scrollPane); final JButton btnUninstall = new JButton("Uninstall"); btnUninstall.setToolTipText("Uninstall the selected app"); btnUninstall.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PrivAppUninstallDone.setText(""); if (list.getSelectedValue() == null) { JOptionPane.showMessageDialog(null, "Please select an app first"); } else { try { AppStatus.setText("Uninstalling..."); Process p1 = Runtime.getRuntime().exec("adb remount"); p1.waitFor(); String[] commands = new String[3]; commands[0] = "adb shell su -c rm -r"; commands[1] = "/system/priv-app/"; commands[2] = " " + list.getSelectedValue(); Process p2 = Runtime.getRuntime().exec(commands, null); p2.waitFor(); Process p3 = Runtime.getRuntime() .exec("adb shell ls /system/priv-app/ > /sdcard/.privapps.txt"); p3.waitFor(); Process p4 = Runtime.getRuntime().exec("adb pull /sdcard/.privapps.txt"); p4.waitFor(); Process p5 = Runtime.getRuntime().exec("adb shell rm /sdcard/.privapps.txt"); p5.waitFor(); lines = IOUtils.readLines(new FileInputStream(".privapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return values.length; } public Object getElementAt(int index) { return values[index]; } }); scrollPane.setViewportView(list); File file = new File(".privapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } AppStatus.setText("App has been uninstalled successfully"); PrivAppUninstallDone .setIcon(new ImageIcon(Interface.class.getResource("/graphics/Smalldone.png"))); btnUninstall.setSelected(false); } catch (Exception e1) { System.err.println(e1); } } } }); btnUninstall.setBounds(26, 327, 107, 27); contentPane.add(btnUninstall); JButton btnRefresh = new JButton("Refresh"); btnRefresh.setToolTipText("Refresh the apps list"); btnRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { Process p1 = Runtime.getRuntime() .exec("adb shell ls /system/priv-app/ > /sdcard/.privapps.txt"); p1.waitFor(); Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.privapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.privapps.txt"); p3.waitFor(); lines = IOUtils.readLines(new FileInputStream(".privapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return values.length; } public Object getElementAt(int index) { return values[index]; } }); scrollPane.setViewportView(list); File file = new File(".privapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } } catch (Exception e1) { System.err.println(e1); } } }); btnRefresh.setBounds(344, 327, 107, 27); contentPane.add(btnRefresh); try { Process p1 = Runtime.getRuntime().exec("adb shell ls /system/priv-app/ > /sdcard/.privapps.txt"); p1.waitFor(); Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.privapps.txt"); p2.waitFor(); Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.privapps.txt"); p3.waitFor(); lines = IOUtils.readLines(new FileInputStream(".privapps.txt")); values = new String[lines.size()]; values = lines.toArray(values); list = new JList(); list.setModel(new AbstractListModel() { public int getSize() { return values.length; } public Object getElementAt(int index) { return values[index]; } }); scrollPane.setViewportView(list); JLabel lblNewLabel = new JLabel("Note: You should also remove app's odex file if it exits "); lblNewLabel.setBounds(25, 374, 438, 17); contentPane.add(lblNewLabel); JLabel lblNeedsRootAnd = new JLabel("Needs root and does not work on production android builds!"); lblNeedsRootAnd.setBounds(25, 426, 454, 17); contentPane.add(lblNeedsRootAnd); JLabel lblOnlyForAndroid = new JLabel("Uninstallation only for android 4.4.x and higher!"); lblOnlyForAndroid.setBounds(8, 452, 450, 15); contentPane.add(lblOnlyForAndroid); File file = new File(".privapps.txt"); if (file.exists() && !file.isDirectory()) { file.delete(); } } catch (Exception e) { System.err.println(e); } }
From source file:utybo.easypastebin.windows.MainWindow.java
/** * Creates the window//from w ww . j av a2s. c o m */ @SuppressWarnings({ "rawtypes", "unchecked" }) public MainWindow() { EasyPastebin.LOGGER.log("Initializing the window", SinkJLevel.INFO); setTitle("EasyPastebin"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 664, 431); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); setContentPane(contentPane); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); contentPane.add(tabbedPane, BorderLayout.CENTER); JPanel main = new JPanel(); tabbedPane.addTab("EasyPastebin", null, main, null); main.setLayout(null); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(62, 39, 312, 132); main.add(scrollPane); pasteContent = new JTextArea(); pasteContent.setFont(new Font("Monospaced", Font.PLAIN, 11)); pasteContent.setWrapStyleWord(true); pasteContent.setLineWrap(true); pasteContent.setToolTipText("Put your paste here!"); scrollPane.setViewportView(pasteContent); JLabel titleLabel = new JLabel("Title :"); titleLabel.setFont(new Font("Tahoma", Font.PLAIN, 12)); titleLabel.setBounds(10, 11, 42, 21); main.add(titleLabel); pasteTitle = new JTextField(); pasteTitle.setBounds(62, 12, 312, 20); main.add(pasteTitle); pasteTitle.setColumns(10); JLabel lblPaste = new JLabel("Paste :"); lblPaste.setForeground(Color.RED); lblPaste.setFont(new Font("Tahoma", Font.PLAIN, 12)); lblPaste.setBounds(10, 85, 53, 21); main.add(lblPaste); pasteExpireDate = new JComboBox(); pasteExpireDate.setFont(new Font("Tahoma", Font.PLAIN, 12)); pasteExpireDate.setModel(new DefaultComboBoxModel(EnumExpireDate.values())); pasteExpireDate.setBounds(468, 12, 155, 21); main.add(pasteExpireDate); JLabel lblExpireDate = new JLabel("Expire Date :"); lblExpireDate.setFont(new Font("Tahoma", Font.PLAIN, 12)); lblExpireDate.setBounds(384, 14, 81, 14); main.add(lblExpireDate); JLabel lblfieldsInRed = new JLabel("(Fields in red are required)"); lblfieldsInRed.setBounds(72, 182, 302, 14); main.add(lblfieldsInRed); btnSubmit = new JButton("Submit!"); btnSubmit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { EasyPastebin.LOGGER.log("Starting Submit script", SinkJLevel.INFO); btnSubmit.setEnabled(false); btnSubmit.setText("Please wait..."); boolean success = true; String paste = pasteContent.getText(); String title = pasteTitle.getText(); EnumExpireDate expireDate = (EnumExpireDate) pasteExpireDate.getSelectedItem(); if (paste.equals("") || paste.equals(" ") || paste.equals(null)) { pastebinUrl.setText("ERROR"); JOptionPane.showMessageDialog(null, "You cannot send empty pastes!", "Error while processing paste", JOptionPane.ERROR_MESSAGE); } else { try { EasyPastebin.LOGGER.log("Setting options", SinkJLevel.INFO); Map map = new HashMap<String, String>(); map.put("api_dev_key", HttpHelper.API_KEY); map.put("api_option", "paste"); map.put("api_paste_code", paste); if (!(expireDate.equals(null) || expireDate.equals(EnumExpireDate.NEVER))) map.put("api_paste_expire_date", expireDate.getRawName()); if (!(title.equals("") || title.equals(" ") || title.equals(null))) map.put("api_paste_name", title); EasyPastebin.LOGGER.log("Sending paste", SinkJLevel.INFO); String actionResult = HttpHelper.sendPost("http://pastebin.com/api/api_post.php", map) .asString(); EasyPastebin.LOGGER.log("Paste sent, checking output", SinkJLevel.INFO); // Exception handlers if (actionResult.equals("Bad API request, invalid api_option")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste. Incorrect Pastebin option!", "Error", JOptionPane.ERROR_MESSAGE); } if (actionResult.equals("Bad API request, invalid api_dev_key")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste. Incorrect dev key! Try again with a more recent version!", "Error", JOptionPane.ERROR_MESSAGE); } if (actionResult.equals("Bad API request, IP blocked")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste. Your IP is blocked!", "Error", JOptionPane.ERROR_MESSAGE); } if (actionResult.equals( "Bad API request, maximum number of 25 unlisted pastes for your free account")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); } if (actionResult.equals( "Bad API request, maximum number of 10 private pastes for your free account")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); } if (actionResult.equals("Bad API request, api_paste_code was empty")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); } if (actionResult.equals("Bad API request, maximum paste file size exceeded")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste. Your paste is too big!", "Error", JOptionPane.ERROR_MESSAGE); } if (actionResult.equals("Bad API request, invalid api_expire_date")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste. Invalid expire date!", "Error", JOptionPane.ERROR_MESSAGE); } if (actionResult.equals("Bad API request, invalid api_paste_private")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste. Invalid privacy value!", "Error", JOptionPane.ERROR_MESSAGE); } if (actionResult.equals("Bad API request, invalid api_paste_format")) { success = false; EasyPastebin.LOGGER.log( "The output is an error message : " + actionResult + ". Submit script failed!", SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste. Invalid format!", "Error", JOptionPane.ERROR_MESSAGE); } // END // Starting display stuff if (success == false) { EasyPastebin.LOGGER.log("Submit script failed : success == false", SinkJLevel.ERROR); pastebinUrl.setText("ERROR"); } if (success == true) { EasyPastebin.LOGGER.log("Paste sent! Starting display script!", SinkJLevel.INFO); pastebinUrl.setText(actionResult); JOptionPane.showMessageDialog(null, "Paste successfully sent!", "Done!", JOptionPane.INFORMATION_MESSAGE); EasyPastebin.LOGGER.log("Display script finished! Paste URL is : " + actionResult, SinkJLevel.INFO); } } catch (ClientProtocolException e) { EasyPastebin.LOGGER.log("Unexpected error! " + e, SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste : " + e, "Error", JOptionPane.ERROR_MESSAGE); e.printStackTrace(); } catch (IOException e) { EasyPastebin.LOGGER.log("Unexpected error! " + e, SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste : " + e, "Error", JOptionPane.ERROR_MESSAGE); e.printStackTrace(); } catch (MissingParamException e) { EasyPastebin.LOGGER.log("Unexpected error! " + e, SinkJLevel.ERROR); JOptionPane.showMessageDialog(null, "Error while processing paste : " + e + "! This is a severe programming error! Try again with a more recent version!", "Error", JOptionPane.ERROR_MESSAGE); e.printStackTrace(); } } EasyPastebin.LOGGER.log("Re-enabling the Submit button ", SinkJLevel.INFO); btnSubmit.setEnabled(true); btnSubmit.setText("Submit another paste!"); EasyPastebin.LOGGER.log("Finished submit script! Success : " + success, SinkJLevel.INFO); } }); btnSubmit.setBounds(386, 45, 237, 44); main.add(btnSubmit); pastebinUrl = new JTextField(); pastebinUrl.setText("The paste's URL will be shown here!"); pastebinUrl.setEditable(false); pastebinUrl.setBounds(384, 198, 239, 32); main.add(pastebinUrl); pastebinUrl.setColumns(10); JPanel about = new JPanel(); tabbedPane.addTab("About", null, about, null); JLabel label = new JLabel("EasyPastebin"); label.setBounds(12, 12, 623, 39); label.setHorizontalAlignment(SwingConstants.CENTER); label.setFont(new Font("Dialog", Font.PLAIN, 25)); JLabel lblTheEasiestWay = new JLabel("The easiest way to use Pastebin.com"); lblTheEasiestWay.setBounds(12, 63, 623, 32); lblTheEasiestWay.setFont(new Font("Dialog", Font.PLAIN, 16)); lblTheEasiestWay.setHorizontalAlignment(SwingConstants.CENTER); about.setLayout(null); about.add(label); about.add(lblTheEasiestWay); JButton btnForkM = new JButton("Fork me on Github!"); btnForkM.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { goToUrl("https://github.com/utybo/EasyPastebin"); } }); btnForkM.setBounds(12, 117, 623, 25); about.add(btnForkM); JButton btnCheckOutUtybos = new JButton("Check out utybo's projects!"); btnCheckOutUtybos.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { goToUrl("http://utybo.github.io/"); } }); btnCheckOutUtybos.setBounds(12, 154, 623, 25); about.add(btnCheckOutUtybos); JButton btnGoToPastebincom = new JButton("Go to Pastebin.com!"); btnGoToPastebincom.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { goToUrl("http://www.pastebin.com"); } }); btnGoToPastebincom.setBounds(12, 191, 623, 25); about.add(btnGoToPastebincom); JLabel lblcUtybo = new JLabel( "This soft was made by utybo. It uses Apache's libraries for the interaction with Pastebin's API"); lblcUtybo.setFont(new Font("Dialog", Font.PLAIN, 10)); lblcUtybo.setHorizontalAlignment(SwingConstants.CENTER); lblcUtybo.setBounds(12, 324, 623, 15); about.add(lblcUtybo); JLabel lblClickMeTo = new JLabel("Click me to go to Apache's licence official website"); lblClickMeTo.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { goToUrl("http://www.apache.org/licenses/LICENSE-2.0"); } }); lblClickMeTo.setHorizontalAlignment(SwingConstants.CENTER); lblClickMeTo.setFont(new Font("Dialog", Font.PLAIN, 10)); lblClickMeTo.setBounds(12, 342, 623, 15); about.add(lblClickMeTo); setVisible(true); EasyPastebin.LOGGER.log("Done!", SinkJLevel.INFO); }
From source file:LicenseGenerator.java
/** * Initialize the contents of the frame. *///from w w w.j a v a 2 s . c om private void initialize() { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException ex) { } m_frame = new JFrame(); m_frame.setTitle("License?"); m_frame.setResizable(false); m_frame.setBounds(100, 100, 496, 483); m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); m_frame.getContentPane().setLayout(null); chkDate = new JCheckBox("?"); chkDate.setSelected(true); chkDate.setBounds(6, 6, 103, 23); m_frame.getContentPane().add(chkDate); txtDate = new JTextField(); txtDate.setText("20131231"); txtDate.setHorizontalAlignment(SwingConstants.RIGHT); txtDate.setBounds(131, 7, 193, 21); m_frame.getContentPane().add(txtDate); txtDate.setColumns(10); chkAdapterNum = new JCheckBox("???"); chkAdapterNum.setSelected(true); chkAdapterNum.setBounds(6, 37, 119, 23); m_frame.getContentPane().add(chkAdapterNum); txtAdapterNum = new JTextField(); txtAdapterNum.setText("000012"); txtAdapterNum.setHorizontalAlignment(SwingConstants.RIGHT); txtAdapterNum.setColumns(10); txtAdapterNum.setBounds(131, 38, 193, 21); m_frame.getContentPane().add(txtAdapterNum); chkAdapter = new JCheckBox( "??? (?? ???)"); chkAdapter.setSelected(true); chkAdapter.setBounds(6, 76, 465, 23); m_frame.getContentPane().add(chkAdapter); chkHTTP_C = new JCheckBox("http.c"); chkHTTP_C.setSelected(true); chkHTTP_C.setBounds(43, 130, 76, 23); m_frame.getContentPane().add(chkHTTP_C); txtHTTP_C = new JTextField(); txtHTTP_C.setText("20131231"); txtHTTP_C.setHorizontalAlignment(SwingConstants.RIGHT); txtHTTP_C.setBounds(131, 131, 103, 21); m_frame.getContentPane().add(txtHTTP_C); txtHTTP_C.setColumns(10); chkSOAP_C = new JCheckBox("soap.c"); chkSOAP_C.setSelected(true); chkSOAP_C.setBounds(43, 161, 76, 23); m_frame.getContentPane().add(chkSOAP_C); txtSOAP_C = new JTextField(); txtSOAP_C.setText("20131231"); txtSOAP_C.setHorizontalAlignment(SwingConstants.RIGHT); txtSOAP_C.setColumns(10); txtSOAP_C.setBounds(131, 162, 103, 21); m_frame.getContentPane().add(txtSOAP_C); chkTCP_C = new JCheckBox("tcp.c"); chkTCP_C.setSelected(true); chkTCP_C.setBounds(43, 192, 76, 23); m_frame.getContentPane().add(chkTCP_C); txtTCP_C = new JTextField(); txtTCP_C.setText("20131231"); txtTCP_C.setHorizontalAlignment(SwingConstants.RIGHT); txtTCP_C.setColumns(10); txtTCP_C.setBounds(131, 193, 103, 21); m_frame.getContentPane().add(txtTCP_C); chkUDP_C = new JCheckBox("udp.c"); chkUDP_C.setSelected(true); chkUDP_C.setBounds(43, 223, 76, 23); m_frame.getContentPane().add(chkUDP_C); txtUDP_C = new JTextField(); txtUDP_C.setText("20131231"); txtUDP_C.setHorizontalAlignment(SwingConstants.RIGHT); txtUDP_C.setColumns(10); txtUDP_C.setBounds(131, 224, 103, 21); m_frame.getContentPane().add(txtUDP_C); chkTUXEDO_C = new JCheckBox("tuxedo.c"); chkTUXEDO_C.setSelected(true); chkTUXEDO_C.setBounds(43, 254, 76, 23); m_frame.getContentPane().add(chkTUXEDO_C); txtTUXEDO_C = new JTextField(); txtTUXEDO_C.setText("20131231"); txtTUXEDO_C.setHorizontalAlignment(SwingConstants.RIGHT); txtTUXEDO_C.setColumns(10); txtTUXEDO_C.setBounds(131, 255, 103, 21); m_frame.getContentPane().add(txtTUXEDO_C); chkMQ_C = new JCheckBox("mq.c"); chkMQ_C.setSelected(true); chkMQ_C.setBounds(43, 286, 76, 23); m_frame.getContentPane().add(chkMQ_C); txtMQ_C = new JTextField(); txtMQ_C.setText("20131231"); txtMQ_C.setHorizontalAlignment(SwingConstants.RIGHT); txtMQ_C.setColumns(10); txtMQ_C.setBounds(131, 287, 103, 21); m_frame.getContentPane().add(txtMQ_C); chkHTTP_S = new JCheckBox("http.s"); chkHTTP_S.setSelected(true); chkHTTP_S.setBounds(283, 130, 76, 23); m_frame.getContentPane().add(chkHTTP_S); txtHTTP_S = new JTextField(); txtHTTP_S.setText("20131231"); txtHTTP_S.setHorizontalAlignment(SwingConstants.RIGHT); txtHTTP_S.setColumns(10); txtHTTP_S.setBounds(368, 130, 103, 21); m_frame.getContentPane().add(txtHTTP_S); chkSOAP_S = new JCheckBox("soap.s"); chkSOAP_S.setSelected(true); chkSOAP_S.setBounds(283, 161, 76, 23); m_frame.getContentPane().add(chkSOAP_S); txtSOAP_S = new JTextField(); txtSOAP_S.setText("20131231"); txtSOAP_S.setHorizontalAlignment(SwingConstants.RIGHT); txtSOAP_S.setColumns(10); txtSOAP_S.setBounds(368, 161, 103, 21); m_frame.getContentPane().add(txtSOAP_S); chkTCP_S = new JCheckBox("tcp.s"); chkTCP_S.setSelected(true); chkTCP_S.setBounds(283, 192, 76, 23); m_frame.getContentPane().add(chkTCP_S); txtTCP_S = new JTextField(); txtTCP_S.setText("20131231"); txtTCP_S.setHorizontalAlignment(SwingConstants.RIGHT); txtTCP_S.setColumns(10); txtTCP_S.setBounds(368, 192, 103, 21); m_frame.getContentPane().add(txtTCP_S); chkUDP_S = new JCheckBox("udp.s"); chkUDP_S.setSelected(true); chkUDP_S.setBounds(283, 223, 76, 23); m_frame.getContentPane().add(chkUDP_S); txtUDP_S = new JTextField(); txtUDP_S.setText("20131231"); txtUDP_S.setHorizontalAlignment(SwingConstants.RIGHT); txtUDP_S.setColumns(10); txtUDP_S.setBounds(368, 223, 103, 21); m_frame.getContentPane().add(txtUDP_S); chkTUXEDO_S = new JCheckBox("tuxedo.s"); chkTUXEDO_S.setSelected(true); chkTUXEDO_S.setBounds(283, 254, 76, 23); m_frame.getContentPane().add(chkTUXEDO_S); txtTUXEDO_S = new JTextField(); txtTUXEDO_S.setText("20131231"); txtTUXEDO_S.setHorizontalAlignment(SwingConstants.RIGHT); txtTUXEDO_S.setColumns(10); txtTUXEDO_S.setBounds(368, 254, 103, 21); m_frame.getContentPane().add(txtTUXEDO_S); chkMQ_S = new JCheckBox("mq.s"); chkMQ_S.setSelected(true); chkMQ_S.setBounds(283, 286, 76, 23); m_frame.getContentPane().add(chkMQ_S); txtMQ_S = new JTextField(); txtMQ_S.setText("20131231"); txtMQ_S.setHorizontalAlignment(SwingConstants.RIGHT); txtMQ_S.setColumns(10); txtMQ_S.setBounds(368, 286, 103, 21); m_frame.getContentPane().add(txtMQ_S); JLabel lblAdapterType1 = new JLabel("???"); lblAdapterType1.setBounds(43, 105, 115, 15); m_frame.getContentPane().add(lblAdapterType1); JLabel lblAdapterType2 = new JLabel("??"); lblAdapterType2.setBounds(283, 105, 103, 15); m_frame.getContentPane().add(lblAdapterType2); JLabel lblAdapterDate1 = new JLabel("?"); lblAdapterDate1.setHorizontalAlignment(SwingConstants.RIGHT); lblAdapterDate1.setBounds(168, 106, 66, 15); m_frame.getContentPane().add(lblAdapterDate1); JLabel lblAdapterDate2 = new JLabel("?"); lblAdapterDate2.setHorizontalAlignment(SwingConstants.RIGHT); lblAdapterDate2.setBounds(405, 105, 66, 15); m_frame.getContentPane().add(lblAdapterDate2); JButton cmdLicense = new JButton("?license"); cmdLicense.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cmdLicense_click(e); } }); cmdLicense.setBounds(302, 332, 169, 23); m_frame.getContentPane().add(cmdLicense); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(6, 367, 478, 82); m_frame.getContentPane().add(scrollPane); txtLicense = new JTextArea(); txtLicense.setEditable(false); scrollPane.setViewportView(txtLicense); }