Example usage for java.awt Insets Insets

List of usage examples for java.awt Insets Insets

Introduction

In this page you can find the example usage for java.awt Insets Insets.

Prototype

public Insets(int top, int left, int bottom, int right) 

Source Link

Document

Creates and initializes a new Insets object with the specified top, left, bottom, and right insets.

Usage

From source file:com.wet.wired.jsr.player.JPlayer.java

private JPanel createSliderLayout() {
    slider.setEnabled(false);/*  www . j  av a 2  s.co  m*/

    JPanel sliderPanel = new JPanel();
    sliderPanel.setPreferredSize(close.getSize()); // use default size of
    // button

    GridBagLayout gbl = new GridBagLayout();
    sliderPanel.setLayout(gbl);

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(2, 2, 2, 2);
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridheight = 1;
    gbc.weightx = 1.0;
    gbl.setConstraints(slider, gbc);
    sliderPanel.add(slider);

    return sliderPanel;
}

From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.doctype.ferramentaDoctype.java

/**
 * Mtodo chamado pelos construtores/*from  w w w  .  j ava 2s. co  m*/
 * 
 * @param conteudo
 */
private void initComponents(String conteudo) {
    textAreaSourceCode = new G_TextAreaSourceCode();
    tabelaDoctypes = new TabelaDescricao();
    aplicar = new JButton();

    abrir = new JButton();
    cancelar = new JButton();
    JPanel regraFonteBtn = new JPanel();
    regraFonteBtn.setLayout(new BorderLayout());

    textAreaSourceCode.setTipoHTML();
    new OnChange(textAreaSourceCode, this);
    tabelaDoctypes = new TabelaDescricao();

    salvar = new JButton();
    abrir = new JButton();
    cancelar = new JButton();
    strConteudoalt = new String();

    pnRegra = new JPanel();
    lbRegras1 = new JLabel();
    pnSetaDescricao = new JPanel();

    pnListaErros = new JPanel();
    scrollPanetabLinCod = new JScrollPane();

    pnBotoes = new JPanel();

    buscar = new JButton();
    salvar.setEnabled(false);
    salvaAlteracoes = TxtBuffer.getInstanciaSalvaAlteracoes(textAreaSourceCode.getTextPane(), salvar,
            new JMenuItem(), parentFrame);
    textAreaSourceCode.getTextPane().setEditable(true);
    aplicar.setEnabled(false);
    setBackground(CoresDefault.getCorPaineis());
    Container contentPane = this;// ??
    contentPane.setLayout(new GridLayout(2, 1));

    // ======== pnRegra ========
    {
        // pnRegra.setBorder(criaBorda(""));
        pnRegra.setBorder(criaBorda(LabelPanel.TITULO_REGRA));
        pnRegra.setLayout(new GridLayout(2, 1));
        pnRegra.add(lbRegras1);
        lbRegras1.setText(TradFerramentaDocType.UTILIZAR_ELEMENTOS_CABECALHO);
        lbRegras1.setHorizontalAlignment(SwingConstants.CENTER);
        pnRegra.add(lbRegras1);
        pnRegra.setPreferredSize(new Dimension(700, 60));
    }

    // ======== pnDescricao ========

    aplicar.setText(GERAL.APLICAR);
    aplicar.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            aplicarActionPerformed(e);
        }
    });

    aplicar.setToolTipText(TradFerramentaDocType.DICA_APLICA_DTD);
    aplicar.getAccessibleContext().setAccessibleDescription(TradFerramentaDocType.DICA_APLICA_DTD);
    aplicar.getAccessibleContext().setAccessibleName(TradFerramentaDocType.DICA_APLICA_DTD);
    aplicar.setBounds(10, 0, 150, 25);

    salvar.setText(GERAL.BTN_SALVAR);
    salvar.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            salvarActionPerformed(e);
        }
    });
    salvar.setToolTipText(GERAL.DICA_SALVAR);
    salvar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVAR);
    salvar.getAccessibleContext().setAccessibleName(GERAL.DICA_SALVAR);

    salvar.setBounds(10, 0, 150, 25);

    abrir.setText(GERAL.BTN_ABRIR);
    abrir.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            abrirActionPerformed(e);
        }
    });

    abrir.setToolTipText(Ferramenta_Scripts.DICA_ABRIR);
    abrir.getAccessibleContext().setAccessibleDescription(Ferramenta_Scripts.DICA_ABRIR_HTML);
    abrir.getAccessibleContext().setAccessibleName(Ferramenta_Scripts.DICA_ABRIR_HTML);
    abrir.setBounds(165, 0, 150, 25);

    cancelar.setText(Ferramenta_Imagens.TELA_ANTERIOR);
    cancelar.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            cancelarActionPerformed(e);
        }
    });

    cancelar.setToolTipText(Ferramenta_Imagens.DICA_TELA_ANTERIOR);
    cancelar.getAccessibleContext().setAccessibleDescription(Ferramenta_Imagens.DICA_TELA_ANTERIOR);
    cancelar.getAccessibleContext().setAccessibleName(Ferramenta_Imagens.DICA_BTN_CANCELAR);
    cancelar.setBounds(320, 0, 150, 25);

    // ======== pnParticRotulo ========

    // pnSetaDescricao.setBorder(criaBorda(""));
    GridBagConstraints cons = new GridBagConstraints();
    GridBagLayout layout = new GridBagLayout();
    cons.fill = GridBagConstraints.BOTH;
    cons.weighty = 1;
    cons.weightx = 0.80;

    pnSetaDescricao.setLayout(layout);
    cons.anchor = GridBagConstraints.SOUTHEAST;
    cons.insets = new Insets(0, 0, 0, 10);
    // ======== spParticRotulo ========

    cons.weightx = 0.20;
    pnSetaDescricao.setPreferredSize(new Dimension(400, 60));

    // ======== pnListaErros ========
    {

        pnListaErros.setBorder(criaBorda(TradFerramentaDocType.ESCOLHA_DTD_CORRETO));
        pnListaErros.setLayout(new BorderLayout());
        // ======== scrollPanetabLinCod ========
        {
            scrollPanetabLinCod.setViewportView(tabelaDoctypes);
        }
        pnListaErros.add(scrollPanetabLinCod, BorderLayout.CENTER);
    }
    // ======== pnBotoes ========
    {

        // pnBotoes.setBorder(criaBorda(""));

        pnBotoes.setLayout(null);
        // ---- adicionar ----

        // ---- aplicarRotulo ----

        buscar.setText(TradSimuladorNavegacao.BUSCAR_PROXIMA);
        buscar.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                aplicarActionPerformed(e);
            }
        });

        buscar.setToolTipText(TradSimuladorNavegacao.BUSCAR_TEXTO);
        buscar.getAccessibleContext().setAccessibleDescription(TradSimuladorNavegacao.BUSCAR_TEXTO);
        buscar.getAccessibleContext().setAccessibleName(TradSimuladorNavegacao.BUSCAR_TEXTO);
        buscar.setBounds(10, 5, 150, 25);
        // pnBotoes.add(buscar);
    }

    /*
     * Colocar os controles
     */
    pnRegra.setBackground(CoresDefault.getCorPaineis());
    regraFonteBtn.add(pnRegra, BorderLayout.NORTH);
    textAreaSourceCode.setBorder(criaBorda(TradFerramentaDocType.CODIGO_FONTE));
    textAreaSourceCode.setBackground(CoresDefault.getCorPaineis());

    regraFonteBtn.add(textAreaSourceCode, BorderLayout.CENTER);
    pnBotoes.setPreferredSize(new Dimension(600, 35));
    pnBotoes.setBackground(CoresDefault.getCorPaineis());

    regraFonteBtn.setBackground(CoresDefault.getCorPaineis());
    contentPane.add(regraFonteBtn);

    JPanel textoErrosBtn = new JPanel();
    textoErrosBtn.setLayout(new BorderLayout());
    pnSetaDescricao.setBackground(CoresDefault.getCorPaineis());
    pnSetaDescricao.add(pnBotoes, cons);
    textoErrosBtn.add(pnSetaDescricao, BorderLayout.NORTH);

    textoErrosBtn.add(pnListaErros, BorderLayout.CENTER);
    pnSalvarCancelar.setLayout(null);
    pnSalvarCancelar.setPreferredSize(new Dimension(600, 35));
    pnSalvarCancelar.add(abrir);
    pnSalvarCancelar.add(salvar);
    pnSalvarCancelar.add(cancelar);

    if (!original) {
        reverter = new JButton("Reverter");
        reverter.setText(TradPainelRelatorio.REVERTER);
        reverter.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
                TxtBuffer.setContent(TxtBuffer.getContentOriginal());
                parentFrame.showPainelFerramentaDoctypePArq(TxtBuffer.getContentOriginal());
                setVisible(true);
            }
        });
        reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER);
        reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER);
        reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER);
        reverter.setBounds(485, 0, 150, 25);
        pnSalvarCancelar.add(reverter);
    }

    pnSalvarCancelar.setBackground(CoresDefault.getCorPaineis());
    textoErrosBtn.add(pnSalvarCancelar, BorderLayout.SOUTH);
    pnListaErros.setBackground(CoresDefault.getCorPaineis());

    contentPane.setBackground(CoresDefault.getCorPaineis());
    contentPane.add(textoErrosBtn);
    controla(conteudo);
    this.setVisible(true);

}

From source file:com.att.aro.ui.view.videotab.VideoTab.java

/**
 * TopPanel contains summaries//  w w  w  .j av a2  s  .co m
 */
private JPanel buildSummariesGroup() {

    JPanel topPanel;
    topPanel = new JPanel(new GridBagLayout());

    topPanel.setOpaque(false);
    topPanel.setBorder(new RoundedBorder(new Insets(20, 20, 20, 20), Color.WHITE));
    int section = 0;

    // Trace Summary, common with Best Practices and Statistics
    DateTraceAppDetailPanel dateTraceAppDetailPanel = new DateTraceAppDetailPanel();
    topPanel.add(dateTraceAppDetailPanel, new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0));
    bpObservable.registerObserver(dateTraceAppDetailPanel);

    // Separator
    topPanel.add(UIComponent.getInstance().getSeparator(), new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 10, 0), 0, 0));

    topPanel.add(getTitle(), new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL, insets, 0, 0));

    // VideoSummaryPanel
    VideoSummaryPanel videoSummaryPanel = new VideoSummaryPanel();
    localRefreshList.add(videoSummaryPanel);
    topPanel.add(videoSummaryPanel, new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0));
    bpObservable.registerObserver(videoSummaryPanel);

    return topPanel;
}

From source file:com.sec.ose.osi.ui.dialog.setting.JPanProxySetting.java

private JPanel getJPanelButtons() {
    if (jPanelButtons == null) {
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints1.gridy = 1;/*w w  w . j a v a  2  s . c o m*/
        gridBagConstraints1.gridx = 0;
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.insets = new Insets(0, 0, 10, 0);
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridx = 0;
        jPanelButtons = new JPanel();
        jPanelButtons.setLayout(new GridBagLayout());
        jPanelButtons.add(getJButtonOK(), gridBagConstraints);
        jPanelButtons.add(getJButtonCancel(), gridBagConstraints1);
    }
    return jPanelButtons;
}

From source file:net.pms.newgui.LanguageSelection.java

private void setStrings() {
    dialog.setLocale(locale);/*from  ww w  .ja  v a 2 s.  com*/
    dialog.applyComponentOrientation(ComponentOrientation.getOrientation(locale));

    selectionPanelBorder.setTitle(buildString("LanguageSelection.1"));

    selectionPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5),
            BorderFactory.createCompoundBorder(selectionPanelBorder,
                    BorderFactory.createEmptyBorder(10, 5, 10, 5))));

    String descriptionMessage = parentComponent != null ? "LanguageSelection.7" : "LanguageSelection.2";
    if (Messages.getString(descriptionMessage, locale).equals(Messages.getRootString(descriptionMessage))) {
        if (parentComponent != null) {
            descriptionText.setText(String.format(Messages.getString(descriptionMessage, locale), PMS.NAME));
        } else {
            descriptionText.setText(String.format(Messages.getString(descriptionMessage, locale), PMS.NAME,
                    Messages.getString("LooksFrame.20", locale)));
        }
    } else {
        if (parentComponent != null) {
            descriptionText.setText(String.format(buildString(descriptionMessage, true), PMS.NAME, PMS.NAME));
        } else {
            descriptionText.setText(String.format(buildString(descriptionMessage, true), PMS.NAME,
                    Messages.getString("LooksFrame.20", locale), PMS.NAME,
                    Messages.getRootString("LooksFrame.20")));
        }
    }
    // Set the width of the text panels by font size to accommodate font scaling
    float avgCharWidth = SwingUtils.getComponentAverageCharacterWidth(descriptionText);
    textWidth = Math.round(avgCharWidth * 100);
    selectButton.setMargin(new Insets(Math.round((float) 0.5 * avgCharWidth), Math.round(4 * avgCharWidth),
            Math.round((float) 0.5 * avgCharWidth), Math.round(4 * avgCharWidth)));
    applyButton.setMargin(new Insets(Math.round((float) 0.5 * avgCharWidth), Math.round(4 * avgCharWidth),
            Math.round((float) 0.5 * avgCharWidth), Math.round(4 * avgCharWidth)));

    descriptionText.setPreferredSize(SwingUtils.getWordWrappedTextDimension(descriptionText, textWidth));

    keyedModel.setData(Languages.getLanguageTags(locale), Languages.getLanguageNames(locale));
    //Try to find a matching locale
    String languageTag = Languages.toLanguageTag(locale);
    int idx;
    if (languageTag != null) {
        idx = keyedModel.findKeyIndex(languageTag);
    } else {
        idx = -1;
    }
    if (idx < 0) {
        // Trying to translate a close match to "our" definition
        Locale tmpLocale = Languages.toLocale(locale);
        if (tmpLocale == null) {
            // Trying to find a supported locale based only on language and country
            tmpLocale = Languages.toLocale(new Locale(locale.getLanguage(), locale.getCountry()));
            if (tmpLocale == null) {
                // Trying to find a supported locale based only on language
                tmpLocale = Languages.toLocale(new Locale(locale.getLanguage()));
                if (tmpLocale == null) {
                    // Giving up, defaulting to US English
                    tmpLocale = Languages.toLocale("en-US");
                }
            }
        }
        // We should be guaranteed to get a valid tag here
        languageTag = Languages.toLanguageTag(tmpLocale);
    }
    keyedModel.setSelectedKey(languageTag);

    if (keyedModel.getSelectedKey() != null && Languages.warnCoverage(keyedModel.getSelectedKey())) {
        String localizedLanguageName = Messages.getString("Language." + keyedModel.getSelectedKey(), locale);
        if (Messages.getString("LanguageSelection.3", locale)
                .equals(Messages.getRootString("LanguageSelection.3"))) {
            warningText.setText(
                    String.format(Messages.getString("LanguageSelection.3", locale), localizedLanguageName,
                            Languages.getLanguageCoverage(keyedModel.getSelectedKey()), localizedLanguageName));
        } else {
            int coverage = Languages.getLanguageCoverage(keyedModel.getSelectedKey());
            String rootLanguageName = Messages.getRootString("Language." + keyedModel.getSelectedKey());
            warningText.setText(String.format(buildString("LanguageSelection.3", true), localizedLanguageName,
                    coverage, localizedLanguageName, rootLanguageName, coverage, rootLanguageName));
        }
    } else {
        warningText.setText("");
    }
    warningText.setPreferredSize(SwingUtils.getWordWrappedTextDimension(warningText, textWidth));

    infoTextBorder.setTitle(buildString("LanguageSelection.4"));

    infoText.setText(
            String.format(buildString("LanguageSelection.5", true, true), PMS.CROWDIN_LINK, PMS.CROWDIN_LINK));
    infoText.setPreferredSize(SwingUtils.getWordWrappedTextDimension(infoText, textWidth,
            StringUtil.stripHTML(infoText.getText())));

    selectButton.setText(buildString("Dialog.Select"));
    applyButton.setText(buildString("Dialog.Apply"));
}

From source file:dk.dma.epd.common.prototype.gui.notification.ChatServicePanel.java

/**
 * Updates the chat message panel in the Swing event thread
 *///  w w w  .j a v  a2s . c om
public void updateChatMessagePanel() {
    // Ensure that we operate in the Swing event thread
    if (!SwingUtilities.isEventDispatchThread()) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                updateChatMessagePanel();
            }
        });
        return;
    }

    // Set the title header
    titleHeader.setText(chatData != null ? NameUtils.getName(chatData.getId(), NameFormat.MEDIUM) : " ");
    titleHeader.setVisible(chatData != null);

    // Only enable send-function when there is chat data, and hence a target
    sendBtn.setEnabled(chatData != null);
    messageText.setEditable(chatData != null);

    // Remove all components from the messages panel
    messagesPanel.removeAll();

    Insets insets = new Insets(0, 2, 2, 2);
    Insets insets2 = new Insets(6, 2, 0, 2);

    if (chatData != null && chatData.getMessageCount() > 0) {

        // First, add a filler component
        int y = 0;
        messagesPanel.add(new JLabel(""),
                new GridBagConstraints(0, y++, 1, 1, 0.0, 1.0, NORTH, VERTICAL, insets, 0, 0));

        // Add the messages
        long lastMessageTime = 0;
        for (EPDChatMessage message : chatData.getMessages()) {

            // Check if we need to add a time label
            if (message.getSendDate().getTime() - lastMessageTime > PRINT_DATE_INTERVAL) {
                JLabel dateLabel = new JLabel(
                        String.format(message.isOwnMessage() ? "Sent to %s" : "Received %s",
                                Formatter.formatShortDateTimeNoTz(new Date(message.getSendDate().getTime()))));
                dateLabel.setFont(dateLabel.getFont().deriveFont(9.0f).deriveFont(Font.PLAIN));
                dateLabel.setHorizontalAlignment(SwingConstants.CENTER);
                dateLabel.setForeground(Color.LIGHT_GRAY);
                messagesPanel.add(dateLabel,
                        new GridBagConstraints(0, y++, 1, 1, 1.0, 0.0, NORTH, HORIZONTAL, insets2, 0, 0));
            }

            // Add a chat message field
            JPanel msg = new JPanel();
            msg.setBorder(new ChatMessageBorder(message));
            JLabel msgLabel = new ChatMessageLabel(message.getMsg(), message.isOwnMessage());
            msg.add(msgLabel);
            messagesPanel.add(msg,
                    new GridBagConstraints(0, y++, 1, 1, 1.0, 0.0, NORTH, HORIZONTAL, insets, 0, 0));

            lastMessageTime = message.getSendDate().getTime();
        }

        // Scroll to the bottom
        validate();
        scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum());
        messagesPanel.repaint();

    } else if (chatData == null && noDataComponent != null) {
        // The noDataComponent may e.g. be a message
        messagesPanel.add(noDataComponent,
                new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, NORTH, BOTH, insets, 0, 0));
    }
}

From source file:com.sshtools.common.ui.SshToolsApplicationApplet.java

/**
 *
 *
 * @param t/*from  w ww.j  a  v a  2s. c o m*/
 */
protected void seriousAppletError(Throwable t) {
    StringBuffer buf = new StringBuffer();
    buf.append("<html><p>A serious error has occured ...</p><br>");
    buf.append("<p><font size=\"-1\" color=\"#ff0000\"><b>");

    StringWriter writer = new StringWriter();
    t.printStackTrace(new PrintWriter(writer, true));

    StringTokenizer tk = new StringTokenizer(writer.toString(), "\n");

    while (tk.hasMoreTokens()) {
        String msg = tk.nextToken();
        buf.append(msg);

        if (tk.hasMoreTokens()) {
            buf.append("<br>");
        }
    }

    buf.append("</b></font></p><html>");

    SshToolsApplicationAppletPanel p = new SshToolsApplicationAppletPanel();
    p.setLayout(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.insets = new Insets(0, 0, 8, 0);
    gbc.fill = GridBagConstraints.NONE;
    UIUtil.jGridBagAdd(p, new JLabel(buf.toString()), gbc, GridBagConstraints.REMAINDER);
    setAppletComponent(p);
}

From source file:com.archivas.clienttools.arcmover.gui.panels.ProfilePanel.java

private void initGuiComponents() {
    fileListModel = new FileListTableModel();
    fileList = new FileListTable(fileListModel);
    fileList.addKeyListener(new KeyAdapter() {
        @Override//from  w ww . ja v  a 2  s.c  o m
        public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                openSelectedFile();
                e.consume();
            }
        }
    });
    fileList.setAutoCreateColumnsFromModel(true);
    fileList.setDropMode(DropMode.ON_OR_INSERT_ROWS);
    fileList.setFillsViewportHeight(true);
    fileList.setGridColor(new Color(-1));

    fileListScrollPane = new JScrollPane(fileList);
    fileListScrollPane.setAutoscrolls(false);
    fileListScrollPane.setBackground(UIManager.getColor("TableHeader.background"));
    fileListScrollPane.setPreferredSize(new Dimension(100, 128));
    fileListScrollPane.setEnabled(false);

    //
    // toolbar
    //

    final JToolBar toolBar1 = new JToolBar();
    toolBar1.setBorderPainted(false);
    toolBar1.setFloatable(false);
    toolBar1.setRollover(true);
    toolBar1.putClientProperty("JToolBar.isRollover", Boolean.TRUE);

    homeDirectoryButton = new JButton();
    homeDirectoryButton.setHorizontalAlignment(2);
    homeDirectoryButton.setIcon(GUIHelper.HOME_ICON);
    homeDirectoryButton.setMargin(new Insets(3, 3, 3, 3));
    homeDirectoryButton.setText("");
    homeDirectoryButton.setToolTipText("Go to home directory");
    homeDirectoryButton.setEnabled(false);
    toolBar1.add(homeDirectoryButton);

    refreshButton = new JButton();
    refreshButton.setHorizontalAlignment(2);
    refreshButton.setIcon(new ImageIcon(getClass().getResource("/images/refresh.gif")));
    refreshButton.setMargin(new Insets(3, 3, 3, 3));
    refreshButton.setText("");
    refreshButton.setToolTipText("Refresh current directory listing");
    refreshButton.setEnabled(false);
    toolBar1.add(refreshButton);

    upDirectoryButton = new JButton();
    upDirectoryButton.setHideActionText(false);
    upDirectoryButton.setHorizontalAlignment(2);
    upDirectoryButton.setIcon(GUIHelper.UP_DIR_ICON);
    upDirectoryButton.setMargin(new Insets(3, 3, 3, 3));
    upDirectoryButton.setToolTipText("Up");
    upDirectoryButton.setEnabled(false);
    toolBar1.add(upDirectoryButton);

    browseDirectoryButton = new JButton();
    browseDirectoryButton.setHideActionText(false);
    browseDirectoryButton.setHorizontalAlignment(2);
    browseDirectoryButton.setIcon(GUIHelper.DIRECTORY_ICON);
    browseDirectoryButton.setMargin(new Insets(3, 3, 3, 3));
    browseDirectoryButton.setToolTipText(BROWSE_LFS_TEXT);
    browseDirectoryButton.setEnabled(false);
    toolBar1.add(browseDirectoryButton);

    profileModel = new ProfileComboBoxModel();
    profileSelectionCombo = new JComboBox(profileModel);
    profileSelectionCombo.setEnabled(false);
    profileSelectionCombo.setToolTipText("Select a namespace profile");
    profileSelectionCombo.setPrototypeDisplayValue("#");

    pathCombo = new JComboBox();
    pathCombo.setEditable(false);
    pathCombo.setEnabled(false);
    pathCombo.setToolTipText("Current directory path");
    pathCombo.setPrototypeDisplayValue("#");

    sslButton = new JButton();
    sslButton.setAlignmentY(0.0f);
    sslButton.setBorderPainted(false);
    sslButton.setHorizontalAlignment(2);
    sslButton.setHorizontalTextPosition(11);
    sslButton.setIcon(new ImageIcon(getClass().getResource("/images/lockedstate.gif")));
    sslButton.setMargin(new Insets(0, 0, 0, 0));
    sslButton.setMaximumSize(new Dimension(20, 20));
    sslButton.setMinimumSize(new Dimension(20, 20));
    sslButton.setPreferredSize(new Dimension(20, 20));
    sslButton.setText("");
    sslButton.setToolTipText("View certificate");
    sslButton.setEnabled(false);

    //
    // profile and toolbar buttons
    //
    JPanel profileAndToolbarPanel = new FixedHeightPanel();
    profileAndToolbarPanel.setLayout(new BoxLayout(profileAndToolbarPanel, BoxLayout.X_AXIS));
    profileAndToolbarPanel.add(profileSelectionCombo);
    profileAndToolbarPanel.add(Box.createHorizontalStrut(25));
    profileAndToolbarPanel.add(toolBar1);

    //
    // Path & SSLCert button
    //
    JPanel pathPanel = new FixedHeightPanel();
    pathPanel.setLayout(new BoxLayout(pathPanel, BoxLayout.X_AXIS));
    pathCombo.setAlignmentY(CENTER_ALIGNMENT);
    pathPanel.add(pathCombo);
    pathPanel.add(Box.createHorizontalStrut(5));
    sslButton.setAlignmentY(CENTER_ALIGNMENT);
    pathPanel.add(sslButton);

    //
    // Put it all together
    //
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    add(profileAndToolbarPanel);
    add(Box.createVerticalStrut(5));
    add(pathPanel);
    add(Box.createVerticalStrut(5));
    add(fileListScrollPane);
    setBorder(new EmptyBorder(12, 12, 12, 12));
}

From source file:DesktopAppTest.java

/**
 * Sets the insets of this cell.//from   w w w.  j  ava2 s  .c  o  m
 * 
 * @param distance
 *          the spacing to use in all directions
 * @return this object for further modification
 */
public GBC setInsets(int distance) {
    this.insets = new Insets(distance, distance, distance, distance);
    return this;
}

From source file:com.sec.ose.osi.ui.dialog.setting.JPanProjectAnalysisSetting.java

/**
 * This method initializes jIntRadioTopPanel   
 *    /*w w w.j  a v a2 s  .  c  o  m*/
 * @return javax.swing.JPanel   
 */
private JPanel getJIntRadioTopPanel() {
    if (jIntRadioTopPanel == null) {

        GridBagConstraints gridBagConstraints51 = new GridBagConstraints();
        gridBagConstraints51.gridx = 0;
        gridBagConstraints51.gridy = 2;

        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.anchor = GridBagConstraints.WEST;
        gridBagConstraints.gridy = 8;
        jLabelUserHour = new JLabel();
        jLabelUserHour.setText(" Hour (more than 12 hours)");
        GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
        gridBagConstraints4.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints4.gridy = 8;
        gridBagConstraints4.weightx = 0.0;
        gridBagConstraints4.weighty = 0.0;
        gridBagConstraints4.ipadx = 0;
        gridBagConstraints4.gridx = 1;
        GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
        gridBagConstraints10.anchor = GridBagConstraints.WEST;
        gridBagConstraints10.gridx = 0;
        gridBagConstraints10.gridy = 8;
        gridBagConstraints10.insets = new Insets(0, 0, 0, 0);
        GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
        gridBagConstraints9.anchor = GridBagConstraints.WEST;
        gridBagConstraints9.gridx = 0;
        gridBagConstraints9.gridy = 7;
        gridBagConstraints9.insets = new Insets(0, 0, 0, 0);
        GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
        gridBagConstraints7.anchor = GridBagConstraints.WEST;
        gridBagConstraints7.gridx = 0;
        gridBagConstraints7.gridy = 6;
        gridBagConstraints7.insets = new Insets(0, 0, 0, 0);
        GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
        gridBagConstraints5.anchor = GridBagConstraints.WEST;
        gridBagConstraints5.gridx = 0;
        gridBagConstraints5.gridy = 5;
        gridBagConstraints5.insets = new Insets(0, 0, 0, 0);
        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
        gridBagConstraints3.anchor = GridBagConstraints.WEST;
        gridBagConstraints3.gridx = -1;
        gridBagConstraints3.gridy = 4;
        gridBagConstraints3.insets = new Insets(0, 0, 0, 0);
        GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
        gridBagConstraints6.anchor = GridBagConstraints.WEST;
        gridBagConstraints6.gridwidth = 2;
        gridBagConstraints6.gridx = 0;
        gridBagConstraints6.gridy = 5;
        gridBagConstraints6.insets = new Insets(0, 0, 0, 0);
        jIntRadioTopPanel = new JPanel();
        jIntRadioTopPanel.setLayout(new GridBagLayout());
        jIntRadioTopPanel.add(getJRadioButtonDisable(), gridBagConstraints3);
        jIntRadioTopPanel.add(getJRadioButton12Hour(), gridBagConstraints5);
        jIntRadioTopPanel.add(getJRadioButton24Hour(), gridBagConstraints7);
        jIntRadioTopPanel.add(getJRadioButton48Hour(), gridBagConstraints9);
        jIntRadioTopPanel.add(getJRadioButtonUserHour(), gridBagConstraints10);
        jIntRadioTopPanel.add(getJTextFieldUserHour(), gridBagConstraints4);
        jIntRadioTopPanel.add(jLabelUserHour, gridBagConstraints);
    }
    return jIntRadioTopPanel;
}