Search in sources :

Example 51 with Container

use of java.awt.Container in project jadx by skylot.

the class LogViewer method initUI.

public final void initUI() {
    textPane = new RSyntaxTextArea();
    textPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
    JPanel controlPane = new JPanel();
    controlPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    @SuppressWarnings("unchecked") final JComboBox cb = new JComboBox(LEVEL_ITEMS);
    cb.setSelectedItem(level);
    cb.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            int i = cb.getSelectedIndex();
            level = LEVEL_ITEMS[i];
            registerLogListener();
        }
    });
    JLabel levelLabel = new JLabel(NLS.str("log.level"));
    levelLabel.setLabelFor(cb);
    controlPane.add(levelLabel);
    controlPane.add(cb);
    JScrollPane scrollPane = new JScrollPane(textPane);
    JButton close = new JButton(NLS.str("tabs.close"));
    close.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent event) {
            close();
        }
    });
    close.setAlignmentX(0.5f);
    Container contentPane = getContentPane();
    contentPane.add(controlPane, BorderLayout.PAGE_START);
    contentPane.add(scrollPane, BorderLayout.CENTER);
    contentPane.add(close, BorderLayout.PAGE_END);
    setTitle("Log Viewer");
    pack();
    setSize(800, 600);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setModalityType(ModalityType.MODELESS);
    setLocationRelativeTo(null);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) Container(java.awt.Container) RSyntaxTextArea(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea) JComboBox(javax.swing.JComboBox) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel)

Example 52 with Container

use of java.awt.Container in project jadx by skylot.

the class SearchDialog method initUI.

private void initUI() {
    JLabel findLabel = new JLabel(NLS.str("search_dialog.open_by_name"));
    searchField = new JTextField();
    searchField.setAlignmentX(LEFT_ALIGNMENT);
    searchField.getDocument().addDocumentListener(new SearchFieldListener());
    new TextStandardActions(searchField);
    JCheckBox clsChBox = makeOptionsCheckBox(NLS.str("search_dialog.class"), SearchOptions.CLASS);
    JCheckBox mthChBox = makeOptionsCheckBox(NLS.str("search_dialog.method"), SearchOptions.METHOD);
    JCheckBox fldChBox = makeOptionsCheckBox(NLS.str("search_dialog.field"), SearchOptions.FIELD);
    JCheckBox codeChBox = makeOptionsCheckBox(NLS.str("search_dialog.code"), SearchOptions.CODE);
    JPanel searchOptions = new JPanel(new FlowLayout(FlowLayout.LEFT));
    searchOptions.setBorder(BorderFactory.createTitledBorder(NLS.str("search_dialog.search_in")));
    searchOptions.add(clsChBox);
    searchOptions.add(mthChBox);
    searchOptions.add(fldChBox);
    searchOptions.add(codeChBox);
    searchOptions.setAlignmentX(LEFT_ALIGNMENT);
    JPanel searchPane = new JPanel();
    searchPane.setLayout(new BoxLayout(searchPane, BoxLayout.PAGE_AXIS));
    findLabel.setLabelFor(searchField);
    searchPane.add(findLabel);
    searchPane.add(Box.createRigidArea(new Dimension(0, 5)));
    searchPane.add(searchField);
    searchPane.add(Box.createRigidArea(new Dimension(0, 5)));
    searchPane.add(searchOptions);
    searchPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    initCommon();
    JPanel resultsPanel = initResultsTable();
    JPanel buttonPane = initButtonsPanel();
    Container contentPane = getContentPane();
    contentPane.add(searchPane, BorderLayout.PAGE_START);
    contentPane.add(resultsPanel, BorderLayout.CENTER);
    contentPane.add(buttonPane, BorderLayout.PAGE_END);
    searchField.addKeyListener(new KeyAdapter() {

        @Override
        public void keyReleased(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                if (resultsModel.getRowCount() != 0) {
                    resultsTable.setRowSelectionInterval(0, 0);
                }
                resultsTable.requestFocus();
            }
        }
    });
    setTitle(NLS.str("menu.text_search"));
    pack();
    setSize(800, 500);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setModalityType(ModalityType.MODELESS);
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BoxLayout(javax.swing.BoxLayout) KeyAdapter(java.awt.event.KeyAdapter) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField) TextStandardActions(jadx.gui.utils.TextStandardActions) JCheckBox(javax.swing.JCheckBox) KeyEvent(java.awt.event.KeyEvent) Container(java.awt.Container)

Example 53 with Container

use of java.awt.Container in project jadx by skylot.

the class UsageDialog method initUI.

private void initUI() {
    JLabel lbl = new JLabel(NLS.str("usage_dialog.label"));
    JLabel nodeLabel = new JLabel(this.node.makeLongString(), this.node.getIcon(), SwingConstants.LEFT);
    lbl.setLabelFor(nodeLabel);
    JPanel searchPane = new JPanel();
    searchPane.setLayout(new FlowLayout(FlowLayout.LEFT));
    searchPane.add(lbl);
    searchPane.add(nodeLabel);
    searchPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    initCommon();
    JPanel resultsPanel = initResultsTable();
    JPanel buttonPane = initButtonsPanel();
    Container contentPane = getContentPane();
    contentPane.add(searchPane, BorderLayout.PAGE_START);
    contentPane.add(resultsPanel, BorderLayout.CENTER);
    contentPane.add(buttonPane, BorderLayout.PAGE_END);
    setTitle(NLS.str("usage_dialog.title"));
    pack();
    setSize(800, 500);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setModalityType(ModalityType.MODELESS);
}
Also used : JPanel(javax.swing.JPanel) Container(java.awt.Container) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel)

Example 54 with Container

use of java.awt.Container in project jadx by skylot.

the class AboutDialog method initUI.

public final void initUI() {
    Font font = new Font("Serif", Font.BOLD, 13);
    JLabel name = new JLabel("jadx");
    name.setFont(font);
    name.setAlignmentX(0.5f);
    JLabel desc = new JLabel("Dex to Java decompiler");
    desc.setFont(font);
    desc.setAlignmentX(0.5f);
    JLabel version = new JLabel("version: " + JadxDecompiler.getVersion());
    version.setFont(font);
    version.setAlignmentX(0.5f);
    JPanel textPane = new JPanel();
    textPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
    textPane.setLayout(new BoxLayout(textPane, BoxLayout.PAGE_AXIS));
    textPane.add(Box.createRigidArea(new Dimension(0, 10)));
    textPane.add(name);
    textPane.add(Box.createRigidArea(new Dimension(0, 10)));
    textPane.add(desc);
    textPane.add(Box.createRigidArea(new Dimension(0, 10)));
    textPane.add(version);
    textPane.add(Box.createRigidArea(new Dimension(0, 20)));
    JButton close = new JButton(NLS.str("tabs.close"));
    close.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent event) {
            dispose();
        }
    });
    close.setAlignmentX(0.5f);
    Container contentPane = getContentPane();
    contentPane.add(textPane, BorderLayout.CENTER);
    contentPane.add(close, BorderLayout.PAGE_END);
    setModalityType(ModalityType.APPLICATION_MODAL);
    setTitle("About JADX");
    pack();
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setLocationRelativeTo(null);
}
Also used : JPanel(javax.swing.JPanel) Container(java.awt.Container) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) Font(java.awt.Font)

Example 55 with Container

use of java.awt.Container in project scriptographer by scriptographer.

the class Image method waitForImage.

public static java.awt.Image waitForImage(java.awt.Image image) {
    MediaTracker mediaTracker = new MediaTracker(new Container());
    mediaTracker.addImage(image, 0);
    try {
        mediaTracker.waitForID(0);
        if (image.getWidth(null) == -1 || image.getHeight(null) == -1)
            image = null;
    } catch (InterruptedException e) {
        image = null;
    }
    return image;
}
Also used : MediaTracker(java.awt.MediaTracker) Container(java.awt.Container)

Aggregations

Container (java.awt.Container)250 JPanel (javax.swing.JPanel)70 JLabel (javax.swing.JLabel)65 JButton (javax.swing.JButton)56 JScrollPane (javax.swing.JScrollPane)55 BoxLayout (javax.swing.BoxLayout)50 FlowLayout (java.awt.FlowLayout)49 Component (java.awt.Component)46 BorderLayout (java.awt.BorderLayout)44 Dimension (java.awt.Dimension)39 ActionEvent (java.awt.event.ActionEvent)38 ActionListener (java.awt.event.ActionListener)26 JComponent (javax.swing.JComponent)22 JFrame (javax.swing.JFrame)22 JmriJFrame (jmri.util.JmriJFrame)20 Border (javax.swing.border.Border)18 JTable (javax.swing.JTable)17 JTextArea (javax.swing.JTextArea)17 Frame (java.awt.Frame)16 JTextField (javax.swing.JTextField)16