Example usage for java.awt GridBagConstraints NORTHEAST

List of usage examples for java.awt GridBagConstraints NORTHEAST

Introduction

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

Prototype

int NORTHEAST

To view the source code for java.awt GridBagConstraints NORTHEAST.

Click Source Link

Document

Put the component at the top-right corner of its display area.

Usage

From source file:savant.view.swing.Frame.java

/**
 * Set the tracks associated with this frame. Normally, this should only be
 * done once, since the Frame also uses this opportunity to set up some GUI
 * elements which depend on the presence of loaded tracks.
 *
 * @param newTracks the tracks to be displayed in this frame
 *///from  w  w  w .  j  a va 2  s . c  o  m
public void setTracks(Track[] newTracks) {
    Track t0 = newTracks[0];
    DataFormat df = t0.getDataFormat();

    if (!GenomeController.getInstance().isGenomeLoaded() && df != DataFormat.SEQUENCE) {
        handleEvent(new TrackCreationEvent(new Exception()));
        for (Track track : newTracks) {
            TrackController.getInstance().removeTrack(track);
        }
        DialogUtils.displayError("Sorry",
                "This does not appear to be a genome track. Please load a genome first.");
        return;
    }
    if (df == DataFormat.SEQUENCE) {
        GenomeController.getInstance().setSequence((SequenceTrack) newTracks[0]);
    }

    tracks = newTracks;
    graphPane.setTracks(tracks);

    for (Track t : tracks) {
        t.setFrame(this, initialDrawingMode);

        // Adds the track to the TrackController's internal list, and fires a TrackEvent.ADDED event to all listeners.
        TrackController.getInstance().addTrack(t);
    }

    commandBar = new FrameCommandBar(this);

    // We get the name and other properties from the zero'th track.
    setKey(t0.getName());

    if (df != DataFormat.SEQUENCE && df != DataFormat.RICH_INTERVAL) {
        yMaxPanel = new JLabel();
        yMaxPanel.setBorder(BorderFactory.createLineBorder(Color.darkGray));
        yMaxPanel.setBackground(new Color(240, 240, 240));
        yMaxPanel.setOpaque(true);
        yMaxPanel.setAlignmentX(0.5f);

        if (df == DataFormat.ALIGNMENT) {
            // We need to listen to genome changes so that we can redraw mismatches as appropriate.
            GenomeController.getInstance().addListener(new Listener<GenomeChangedEvent>() {
                @Override
                public void handleEvent(GenomeChangedEvent event) {
                    // In certain BAM modes, we care about whether the sequence has been set (or unset).
                    if (event.getNewGenome() == event.getOldGenome()) {
                        forceRedraw();
                    }
                }
            });
        }
    }

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.anchor = GridBagConstraints.NORTHEAST;
    gbc.weightx = 1.0;
    gbc.insets = new Insets(4, 0, 0, 0);
    sidePanel.add(commandBar, gbc);
    sidePanel.add(legend, gbc);
    if (yMaxPanel != null) {
        sidePanel.add(yMaxPanel, gbc);
    }
    gbc.weighty = 1.0;
    gbc.fill = GridBagConstraints.VERTICAL;
    JPanel filler = new JPanel();
    filler.setOpaque(false);
    sidePanel.add(filler, gbc);

    drawTracksInRange(LocationController.getInstance().getReferenceName(),
            LocationController.getInstance().getRange());

    JPanel contentPane = (JPanel) getContentPane();
    contentPane.setLayout(new BorderLayout());
    contentPane.add(frameLandscape);
}

From source file:tufts.vue.EditLibraryPanel.java

private void layoutConfig() {
    if (DEBUG.BOXES) {
        cui.setBorder(BorderFactory.createLineBorder(Color.green));
        this.setBorder(BorderFactory.createLineBorder(Color.red));
    }/*w  w w .  j  a v a  2  s  .  c  om*/

    final GridBagConstraints gbc = new GridBagConstraints();
    final GridBagLayout gridbag = new GridBagLayout();

    setLayout(gridbag);

    // Set up common GBC config:

    gbc.insets = (Insets) tufts.vue.gui.GUI.WidgetInsets.clone();
    gbc.insets.bottom = 0;
    gbc.weightx = 1;
    gbc.weighty = 0;

    //-------------------------------------------------------
    // Add ConfigurationUI
    //-------------------------------------------------------

    gbc.anchor = GridBagConstraints.NORTH;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.gridy = 0;

    add(cui, gbc);

    //-------------------------------------------------------
    // Add Save button
    //-------------------------------------------------------

    gbc.gridwidth = 1;
    gbc.gridy = 1;
    gbc.ipadx = 15; // this actually makes the button wider
    gbc.anchor = GridBagConstraints.NORTHEAST;
    gbc.fill = GridBagConstraints.NONE;

    add(updateButton, gbc);

    //-------------------------------------------------------
    // Add a default vertical expander so above content
    // will float to top.
    //-------------------------------------------------------

    gbc.ipadx = 0;
    gbc.gridy = 2;
    gbc.weighty = 1; // this is the key for the expander to work (non-zero y-weight)
    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridheight = GridBagConstraints.REMAINDER;
    gbc.gridwidth = 0;

    final JComponent fill;

    if (DEBUG.BOXES) {
        fill = new JLabel(VueResources.getString("jlabel.fill"), JLabel.CENTER);
        fill.setBackground(Color.gray);
        fill.setOpaque(true);
    } else {
        fill = new JPanel();
    }

    add(fill, gbc);
}

From source file:tufts.vue.ui.InspectorPane.java

/** labels & values must be of same length */
private void addLabelTextRows(int starty, JLabel[] labels, JComponent[] values, Container gridBag,
        Font labelFace, Font fieldFace) {
    // Note that the resulting alignment ends up being somehow FONT dependent!
    // E.g., works great with Lucida Grand (MacOSX), but with system default,
    // if the field value is a wrapping JTextPane (thus gets taller as window
    // gets narrower), the first line of text rises slightly and is no longer
    // in line with it's label.

    GridBagConstraints c = new GridBagConstraints();
    c.anchor = GridBagConstraints.EAST;
    c.weighty = 0;//  w ww.  ja  v  a2 s  .  c o  m
    c.gridheight = 1;

    for (int i = 0; i < labels.length; i++) {

        //out("ALTR[" + i + "] label=" + GUI.name(labels[i]) + " value=" + GUI.name(values[i]));

        boolean centerLabelVertically = false;
        final JLabel label = labels[i];
        final JComponent field = values[i];

        if (labelFace != null)
            GUI.apply(labelFace, label);

        if (field instanceof JTextComponent) {
            if (field instanceof JTextField)
                centerLabelVertically = true;
            //                 JTextComponent textField = (JTextComponent) field;
            //                 editable = textField.isEditable();
            //                 if (field instanceof JTextArea) {
            //                     JTextArea textArea = (JTextArea) field;
            //                     c.gridheight = textArea.getRows();
            //                     } else if (field instanceof JTextField)
        } else {
            if (fieldFace != null)
                GUI.apply(fieldFace, field);
        }

        //-------------------------------------------------------
        // Add the field label
        //-------------------------------------------------------

        c.gridx = 0;
        c.gridy = starty++;
        c.insets = labelInsets;
        c.gridwidth = GridBagConstraints.RELATIVE; // next-to-last in row
        c.fill = GridBagConstraints.NONE; // the label never grows
        if (centerLabelVertically)
            c.anchor = GridBagConstraints.EAST;
        else
            c.anchor = GridBagConstraints.NORTHEAST;
        c.weightx = 0.0; // do not expand
        gridBag.add(label, c);

        //-------------------------------------------------------
        // Add the field value
        //-------------------------------------------------------

        c.gridx = 1;
        c.gridwidth = GridBagConstraints.REMAINDER; // last in row
        c.fill = GridBagConstraints.HORIZONTAL;
        c.anchor = GridBagConstraints.CENTER;
        //c.anchor = GridBagConstraints.NORTH;
        c.insets = fieldInsets;
        c.weightx = 1.0; // field value expands horizontally to use all space
        gridBag.add(field, c);

    }

    // add a default vertical expander to take up extra space
    // (so the above stack isn't vertically centered if it
    // doesn't fill the space).

    c.weighty = 1;
    c.weightx = 1;
    c.gridx = 0;
    c.fill = GridBagConstraints.BOTH;
    c.gridwidth = GridBagConstraints.REMAINDER;
    JComponent defaultExpander = new JPanel();
    defaultExpander.setPreferredSize(new Dimension(Short.MAX_VALUE, 1));
    if (DEBUG.BOXES) {
        defaultExpander.setOpaque(true);
        defaultExpander.setBackground(Color.red);
    } else
        defaultExpander.setOpaque(false);
    gridBag.add(defaultExpander, c);
}

From source file:us.paulevans.basicxslt.SaveAsConfigurationFrame.java

/**
 * Builds the north panel//from  w  ww  . j  a va  2  s.  c om
 * @return
 */
private JPanel buildNorthPanel() {

    GridBagLayout layout;
    GridBagConstraints constraints;
    JPanel panel;
    int row, col;

    layout = new GridBagLayout();
    constraints = new GridBagConstraints();
    panel = new JPanel(layout);
    row = 0;
    col = 0;
    JLabel headerLabel = new JLabel(
            stringFactory.getString(LabelStringFactory.SAVEASCONFIG_FRAME_SAVE_NEW_CONFIGURATION));
    headerLabel.setFont(new Font("arial", Font.PLAIN, 18));
    GUIUtils.add(panel, headerLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST,
            GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS);
    return panel;
}

From source file:us.paulevans.basicxslt.SaveAsConfigurationFrame.java

/**
 * Builds the main panel/*  w ww  .  java 2 s .co m*/
 * @return
 */
private JPanel buildMainPanel() {

    int row;
    GridBagLayout layout;
    GridBagConstraints constraints;
    JPanel main;
    JLabel label;

    layout = new GridBagLayout();
    constraints = new GridBagConstraints();
    main = new JPanel(layout);
    row = 0;
    GUIUtils.add(main,
            new JLabel(stringFactory.getString(LabelStringFactory.SAVEASCONFIG_FRAME_CURRENT_CONFIGURATION)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.MED_INSETS);
    GUIUtils.add(main, label = new JLabel(userPrefs.getConfiguration()), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    label.setForeground(Color.BLUE);
    GUIUtils.add(main, new JSeparator(), layout, constraints, row++, 0, 1, 2, 1, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, GUIUtils.MED_INSETS);
    GUIUtils.add(main,
            new JLabel(stringFactory.getString(LabelStringFactory.SAVEASCONFIG_FRAME_CONFIGURATION_NAME)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JScrollPane(configurationName = new JTextField(20)), layout, constraints, row++, 1,
            1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.SAVEASCONFIG_FRAME_MAKE_DEFAULT)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, makeDefault = new JCheckBox(), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    return main;
}

From source file:us.paulevans.basicxslt.TransformOutputPropertiesFrame.java

/**
 * Builds the north panel/* ww  w  .  ja v  a  2  s . co  m*/
 * @param aHeaderLabel
 * @param aFile
 * @return
 */
private JPanel buildNorthPanel(String aHeaderLabel, String aFile) {

    GridBagLayout layout;
    GridBagConstraints constraints;
    JPanel panel;
    int row, col;
    JLabel headerLabel, fileLabel;

    layout = new GridBagLayout();
    constraints = new GridBagConstraints();
    panel = new JPanel(layout);
    headerLabel = new JLabel(aHeaderLabel);
    row = 0;
    col = 0;
    headerLabel.setFont(new Font("arial", Font.PLAIN, 18));
    fileLabel = new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_FILE_LBL) + aFile);
    fileLabel.setFont(new Font("arial", Font.PLAIN, 12));
    GUIUtils.add(panel, headerLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST,
            GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS);
    GUIUtils.add(panel, new JSeparator(), layout, constraints, row++, col, 1, 1, 1, 1,
            GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS);
    GUIUtils.add(panel, fileLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST,
            GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS);
    return panel;
}

From source file:us.paulevans.basicxslt.TransformOutputPropertiesFrame.java

/**
 * Builds the main panel/*from  ww  w  .  j a  va2 s.  co  m*/
 * @return
 */
private JPanel buildMainPanel() {

    int row;
    GridBagLayout layout;
    GridBagConstraints constraints;
    JPanel main;

    layout = new GridBagLayout();
    constraints = new GridBagConstraints();
    main = new JPanel(layout);
    row = 0;
    GUIUtils.add(main,
            new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_CDATA_SECTION_ELEMENTS)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JScrollPane(CDATASectionElements = new JTextArea(3, 30)), layout, constraints, row++,
            1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_DOCTYPE_PUBLIC)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, doctypePublic = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_DOCTYPE_SYSTEM)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, doctypeSystem = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_ENCODING)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, encoding = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_MEDIA_TYPE)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, mediaType = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_METHOD)), layout,
            constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, buildMethodPanel(), layout, constraints, row++, 1, 1, 1, GridBagConstraints.WEST,
            GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_VERSION)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, version = new JTextField(30), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_INDENT)), layout,
            constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, indent = new JCheckBox(), layout, constraints, row++, 1, 1, 1, GridBagConstraints.WEST,
            GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main,
            new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_OMIT_XML_DECLARATION)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, omitXmlDeclaration = new JCheckBox(), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_IS_STANDALONE)),
            layout, constraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(main, standalone = new JCheckBox(), layout, constraints, row++, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    return main;
}

From source file:us.paulevans.basicxslt.TransformParametersFrame.java

/**
 * Builds the north panel// w ww  .  ja v  a 2 s. co m
 * @return
 */
private JPanel buildNorthPanel() {

    GridBagLayout layout;
    GridBagConstraints constraints;
    JPanel panel;
    int row, col;
    JLabel headerLabel;

    layout = new GridBagLayout();
    constraints = new GridBagConstraints();
    panel = new JPanel(layout);
    row = 0;
    col = 0;
    headerLabel = new JLabel(stringFactory.getString(LabelStringFactory.PARAMS_FRAME_TRANSFORM_PARAMETERS)
            + " (" + xslRow.getDescription() + ")");
    headerLabel.setFont(new Font("arial", Font.PLAIN, 18));
    JLabel fileLabel = new JLabel(stringFactory.getString(LabelStringFactory.PARAMS_FRAME_FILE_LBL_WITH_COLON)
            + xslRow.getTextField().getText());
    fileLabel.setFont(new Font("arial", Font.PLAIN, 12));
    GUIUtils.add(panel, headerLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST,
            GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS);
    GUIUtils.add(panel, new JSeparator(), layout, constraints, row++, col, 1, 1, 1, 1,
            GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS);
    GUIUtils.add(panel, fileLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST,
            GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS);
    return panel;
}

From source file:zsk.JFCMainClient.java

/**
 * @param pane/*  www.  j  a v a 2s.  com*/
 * @param downloadDir 
 */
public void addComponentsToPane(final Container pane, String downloadDir) {
    this.panel = new JPanel();

    this.panel.setLayout(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new Insets(5, 5, 5, 5);
    gbc.anchor = GridBagConstraints.WEST;

    JFCMainClient.dlm = new DefaultListModel<String>();
    this.urllist = new JList<String>(JFCMainClient.dlm);
    // TODO maybe we add a button to remove added URLs from list?
    //      this.userlist.setSelectionMode( ListSelectionModel.MULTIPLE_INTERVAL_SELECTION );
    this.urllist.setFocusable(false);
    this.textarea = new JTextArea(2, 2);
    this.textarea.setEditable(true);
    this.textarea.setFocusable(false);

    JScrollPane leftscrollpane = new JScrollPane(this.urllist);
    JScrollPane rightscrollpane = new JScrollPane(this.textarea);
    this.middlepane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftscrollpane, rightscrollpane);
    this.middlepane.setOneTouchExpandable(true);
    this.middlepane.setDividerLocation(150);

    Dimension minimumSize = new Dimension(25, 25);
    leftscrollpane.setMinimumSize(minimumSize);
    rightscrollpane.setMinimumSize(minimumSize);

    this.directorybutton = new JButton("", createImageIcon("images/open.png", ""));
    gbc.gridx = 0;
    gbc.gridy = 0;
    this.directorybutton.addActionListener(this);
    this.panel.add(this.directorybutton, gbc);

    this.saveconfigcheckbox = new JCheckBox(isgerman() ? "Konfig. speichern" : "Save config");
    this.saveconfigcheckbox.setSelected(false);

    this.saveconfigcheckbox.addItemListener(this);
    this.panel.add(this.saveconfigcheckbox);

    this.saveconfigcheckbox.setEnabled(false);

    // TODO check if initial download directory exists
    // assume that at least the users homedir exists
    //if (System.getProperty("user.home").equals("/home/knoedel")) shomedir = "/home/knoedel/YouTube Downloads/";
    debugoutput("user.home: ".concat(System.getProperty("user.home")).concat("  shomedir: ".concat(shomedir)));
    debugoutput("os.name: ".concat(System.getProperty("os.name")));
    debugoutput("os.arch: ".concat(System.getProperty("os.arch")));
    debugoutput("os.version: ".concat(System.getProperty("os.version")));
    debugoutput("Locale.getDefault: ".concat(Locale.getDefault().toString()));

    gbc.gridx = 0;
    gbc.gridy = 2;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    this.directorytextfield = new JTextField(downloadDir, 20 + (JFCMainClient.getbDEBUG() ? 48 : 0));
    //this.directorytextfield = new JTextField( shomedir, 20+(JFCMainClient.getbDEBUG()?48:0) );
    this.directorytextfield.setEnabled(false);
    this.directorytextfield.setFocusable(true);
    this.directorytextfield.addActionListener(this);
    this.panel.add(this.directorytextfield, gbc);

    JLabel dirhint = new JLabel(isgerman() ? "Speichern im Ordner:" : "Download to folder:");

    gbc.gridx = 0;
    gbc.gridy = 1;
    this.panel.add(dirhint, gbc);

    debugoutput(String.format("heigth x width: %d x %d", Toolkit.getDefaultToolkit().getScreenSize().width,
            Toolkit.getDefaultToolkit().getScreenSize().height));

    this.middlepane.setPreferredSize(new Dimension(Toolkit.getDefaultToolkit().getScreenSize().width / 3,
            Toolkit.getDefaultToolkit().getScreenSize().height / 4 + (JFCMainClient.getbDEBUG() ? 200 : 0)));

    gbc.gridx = 0;
    gbc.gridy = 3;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weighty = 2;
    gbc.weightx = 2;
    gbc.gridwidth = 2;
    this.panel.add(this.middlepane, gbc);

    // radio buttons for resolution to download
    JFCMainClient.frame.hdbutton = new JRadioButton("HD");
    JFCMainClient.frame.hdbutton.setActionCommand("hd");
    JFCMainClient.frame.hdbutton.addActionListener(this);
    JFCMainClient.frame.hdbutton.setToolTipText("1080p/720p");
    JFCMainClient.frame.stdbutton = new JRadioButton("Std");
    JFCMainClient.frame.stdbutton.setActionCommand("std");
    JFCMainClient.frame.stdbutton.addActionListener(this);
    JFCMainClient.frame.stdbutton.setToolTipText("480p/360p");
    JFCMainClient.frame.ldbutton = new JRadioButton("LD");
    JFCMainClient.frame.ldbutton.setActionCommand("ld");
    JFCMainClient.frame.ldbutton.addActionListener(this);
    JFCMainClient.frame.ldbutton.setToolTipText("< 360p");

    JFCMainClient.frame.stdbutton.setSelected(true);
    JFCMainClient.frame.hdbutton.setEnabled(true);
    JFCMainClient.frame.ldbutton.setEnabled(true);

    ButtonGroup bgroup = new ButtonGroup();
    bgroup.add(JFCMainClient.frame.hdbutton);
    bgroup.add(JFCMainClient.frame.stdbutton);
    bgroup.add(JFCMainClient.frame.ldbutton);

    JPanel radiopanel = new JPanel(new GridLayout(1, 0));
    radiopanel.add(JFCMainClient.frame.hdbutton);
    radiopanel.add(JFCMainClient.frame.stdbutton);
    radiopanel.add(JFCMainClient.frame.ldbutton);

    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.gridheight = 0;
    gbc.gridwidth = 0;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.NORTHEAST;
    this.panel.add(radiopanel, gbc);

    // radio buttons for video format to download
    JFCMainClient.frame.mpgbutton = new JRadioButton("MPEG");
    JFCMainClient.frame.mpgbutton.setActionCommand("mpg");
    JFCMainClient.frame.mpgbutton.addActionListener(this);
    JFCMainClient.frame.mpgbutton.setToolTipText("Codec: H.264 MPEG-4");
    JFCMainClient.frame.webmbutton = new JRadioButton("WEBM");
    JFCMainClient.frame.webmbutton.setActionCommand("webm");
    JFCMainClient.frame.webmbutton.addActionListener(this);
    JFCMainClient.frame.webmbutton.setToolTipText("Codec: Google/On2's VP8 or Googles WebM");
    JFCMainClient.frame.flvbutton = new JRadioButton("FLV");
    JFCMainClient.frame.flvbutton.setActionCommand("flv");
    JFCMainClient.frame.flvbutton.addActionListener(this);
    JFCMainClient.frame.flvbutton.setToolTipText("Codec: Flash Video (FLV1)");

    bgroup = new ButtonGroup();
    bgroup.add(JFCMainClient.frame.mpgbutton);
    bgroup.add(JFCMainClient.frame.webmbutton);
    bgroup.add(JFCMainClient.frame.flvbutton);

    JFCMainClient.frame.mpgbutton.setSelected(true);
    JFCMainClient.frame.mpgbutton.setEnabled(true);
    JFCMainClient.frame.webmbutton.setEnabled(true);
    JFCMainClient.frame.flvbutton.setEnabled(true);

    JFCMainClient.frame.save3dcheckbox = new JCheckBox("3D");
    JFCMainClient.frame.save3dcheckbox.setToolTipText("stereoscopic video");
    JFCMainClient.frame.save3dcheckbox.setSelected(false);
    JFCMainClient.frame.save3dcheckbox.setEnabled(true);
    JFCMainClient.frame.save3dcheckbox.addItemListener(this);

    radiopanel = new JPanel(new GridLayout(1, 0));
    radiopanel.add(JFCMainClient.frame.save3dcheckbox);
    radiopanel.add(JFCMainClient.frame.mpgbutton);
    radiopanel.add(JFCMainClient.frame.webmbutton);
    radiopanel.add(JFCMainClient.frame.flvbutton);

    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridheight = 0;
    gbc.gridwidth = 0;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.NORTHEAST;
    this.panel.add(radiopanel, gbc);

    JLabel hint = new JLabel(
            isgerman() ? "eingeben, reinkopieren, reinziehen von YT-Webadressen oder YT-Videobilder:"
                    : "Type, paste or drag'n drop a YouTube video address:");

    gbc.fill = 0;
    gbc.gridwidth = 0;
    gbc.gridheight = 1;
    gbc.weightx = 0;
    gbc.weighty = 0;
    gbc.gridx = 0;
    gbc.gridy = 4;
    gbc.anchor = GridBagConstraints.WEST;
    this.panel.add(hint, gbc);

    this.textinputfield = new JTextField(20);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 0;
    gbc.gridy = 5;
    gbc.gridwidth = 2;
    this.textinputfield.setEnabled(true);
    this.textinputfield.setFocusable(true);
    this.textinputfield.addActionListener(this);
    this.textinputfield.getDocument().addDocumentListener(this);
    this.panel.add(this.textinputfield, gbc);

    this.quitbutton = new JButton("", createImageIcon("images/exit.png", ""));
    gbc.gridx = 2;
    gbc.gridy = 5;
    gbc.gridwidth = 0;
    this.quitbutton.addActionListener(this);
    this.quitbutton.setActionCommand("quit");
    this.quitbutton.setToolTipText("Exit.");

    this.panel.add(this.quitbutton, gbc);

    pane.add(this.panel);
    addWindowListener(this);

    JFCMainClient.frame.setDropTarget(new DropTarget(this, this));
    JFCMainClient.frame.textarea.setTransferHandler(null); // otherwise the dropped text would be inserted

}