Ticket #1908: LineBreaksForAbout.patch

File LineBreaksForAbout.patch, 1.6 KB (added by xeen, 16 years ago)

Replaces JLabel with JTextarea that wraps text nicely

  • \src\org\openstreetmap\josm\actions\AboutAction.java

    old new  
    2828import javax.swing.JScrollPane;
    2929import javax.swing.JTabbedPane;
    3030import javax.swing.JTextArea;
     31import javax.swing.UIManager;
    3132
    3233import org.openstreetmap.josm.Main;
    3334import org.openstreetmap.josm.plugins.PluginProxy;
     
    164165                    JOptionPane.showMessageDialog(Main.parent, new JScrollPane(a));
    165166                }
    166167            }), GBC.eol());
    167             JLabel label = new JLabel("<html><i>"+(p.info.description==null?tr("no description available"):p.info.description)+"</i></html>");
    168             label.setBorder(BorderFactory.createEmptyBorder(0,20,0,0));
    169             label.setMaximumSize(new Dimension(450,1000));
    170             pluginTab.add(label, GBC.eop().fill(GBC.HORIZONTAL));
     168
     169            JTextArea description = new JTextArea((p.info.description==null? tr("no description available"):p.info.description));
     170            description.setEditable(false);
     171            description.setFont(new JLabel().getFont().deriveFont(Font.ITALIC));
     172            description.setLineWrap(true);
     173            description.setWrapStyleWord(true);
     174            description.setBorder(BorderFactory.createEmptyBorder(0,20,0,0));
     175            description.setBackground(UIManager.getColor("Panel.background"));
     176           
     177            pluginTab.add(description, GBC.eop().fill(GBC.HORIZONTAL));
    171178        }
    172179        about.addTab(tr("Plugins"), new JScrollPane(pluginTab));
    173180