Changeset 2823 in josm for trunk


Ignore:
Timestamp:
2010-01-12T08:01:34+01:00 (15 years ago)
Author:
Gubaer
Message:

fixed #4325: Proxy settings field length wrong

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java

    r2822 r2823  
    100100        gc.anchor = GridBagConstraints.WEST;
    101101        gc.insets = new Insets(5,5,0,0);
     102        gc.fill = GridBagConstraints.HORIZONTAL;
     103        gc.weightx = 0.0;
    102104        pnl.add(new JLabel(tr("Host:")), gc);
    103105
    104106        gc.gridx = 1;
    105         pnl.add(tfProxyHttpHost = new JTextField(20),gc);
     107        gc.weightx = 1.0;
     108        pnl.add(tfProxyHttpHost = new JTextField(),gc);
    106109
    107110        gc.gridy = 1;
    108111        gc.gridx = 0;
     112        gc.fill = GridBagConstraints.NONE;
     113        gc.weightx = 0.0;
    109114        pnl.add(new JLabel(trc("server", "Port:")), gc);
    110115
    111116        gc.gridx = 1;
    112         gc.weightx = 0.0;
     117        gc.weightx = 1.0;
    113118        pnl.add(tfProxyHttpPort = new JTextField(5),gc);
     119        tfProxyHttpPort.setMinimumSize(tfProxyHttpPort.getPreferredSize());
    114120
    115121        gc.gridy = 2;
     122        gc.gridx = 0;
     123        gc.gridwidth = 2;
     124        gc.fill = GridBagConstraints.HORIZONTAL;
     125        gc.weightx = 1.0;
     126        pnl.add(new JMultilineLabel(tr("Please enter a username and a password if your proxy requires authentication.")), gc);
     127
     128        gc.gridy = 3;
     129        gc.gridx = 0;
     130        gc.gridwidth = 1;
     131        gc.fill = GridBagConstraints.NONE;
     132        gc.weightx = 0.0;
     133        pnl.add(new JLabel(tr("User:")), gc);
     134
     135        gc.gridy = 3;
     136        gc.gridx = 1;
     137        gc.weightx = 1.0;
     138        pnl.add(tfProxyHttpUser = new JTextField(20),gc);
     139        tfProxyHttpUser.setMinimumSize(tfProxyHttpUser.getPreferredSize());
     140
     141        gc.gridy = 4;
     142        gc.gridx = 0;
     143        gc.weightx = 0.0;
     144        pnl.add(new JLabel(tr("Password:")), gc);
     145
     146        gc.gridx = 1;
     147        gc.weightx = 1.0;
     148        pnl.add(tfProxyHttpPassword = new JPasswordField(20),gc);
     149        tfProxyHttpPassword.setMinimumSize(tfProxyHttpPassword.getPreferredSize());
     150
     151        // add an extra spacer, otherwise the layout is broken
     152        gc.gridy = 5;
    116153        gc.gridx = 0;
    117154        gc.gridwidth = 2;
     
    119156        gc.weightx = 1.0;
    120157        gc.weighty = 1.0;
    121         pnl.add(new JLabel(tr("Please enter a username and a password if your proxy requires authentication.")), gc);
    122 
    123         gc.gridy = 3;
    124         gc.gridx = 0;
    125         gc.gridwidth = 1;
    126         gc.weightx = 0.0;
    127         gc.fill = GridBagConstraints.NONE;
    128         pnl.add(new JLabel(tr("User:")), gc);
    129 
    130         gc.gridy = 3;
    131         gc.gridx = 1;
    132         pnl.add(tfProxyHttpUser = new JTextField(20),gc);
    133 
    134         gc.gridy = 4;
    135         gc.gridx = 0;
    136         pnl.add(new JLabel(tr("Password:")), gc);
    137 
    138         gc.gridx = 1;
    139         pnl.add(tfProxyHttpPassword = new JPasswordField(20),gc);
     158        pnl.add(new JPanel(), gc);
    140159        return pnl;
    141160    }
     
    156175        gc.anchor = GridBagConstraints.WEST;
    157176        gc.insets = new Insets(5,5,0,0);
     177        gc.fill = GridBagConstraints.HORIZONTAL;
     178        gc.weightx = 0.0;
    158179        pnl.add(new JLabel(tr("Host:")), gc);
    159180
    160181        gc.gridx = 1;
     182        gc.weightx = 1.0;
    161183        pnl.add(tfProxySocksHost = new JTextField(20),gc);
    162184
    163185        gc.gridy = 1;
    164186        gc.gridx = 0;
     187        gc.weightx = 0.0;
     188        gc.fill = GridBagConstraints.NONE;
    165189        pnl.add(new JLabel(trc("server", "Port:")), gc);
    166190
    167191        gc.gridx = 1;
    168         pnl.add(tfProxySocksPort = new JTextField(5),gc);
     192        gc.weightx = 1.0;
     193        pnl.add(tfProxySocksPort = new JTextField(5), gc);
     194        tfProxySocksPort.setMinimumSize(tfProxySocksPort.getPreferredSize());
    169195
    170196        // add an extra spacer, otherwise the layout is broken
Note: See TracChangeset for help on using the changeset viewer.