001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.plugins.streetside.gui.boilerplate; 003 004import java.awt.Color; 005import java.awt.Font; 006 007import javax.swing.JTextPane; 008import javax.swing.UIManager; 009 010public class SelectableLabel extends JTextPane { 011 012 private static final long serialVersionUID = 5432480892000739831L; 013 014 public static final Font DEFAULT_FONT = UIManager.getFont("Label.font").deriveFont(Font.PLAIN); 015 public static final Color DEFAULT_BACKGROUND = UIManager.getColor("Panel.background"); 016 017 public SelectableLabel() { 018 super(); 019 init(); 020 } 021 022 public SelectableLabel(String text) { 023 this(); 024 setText(text); 025 } 026 027 private void init() { 028 setEditable(false); 029 setFont(DEFAULT_FONT); 030 setContentType("text/html"); 031 setBackground(DEFAULT_BACKGROUND); 032 setBorder(null); 033 } 034}