src/share/classes/sun/tools/jconsole/LabeledComponent.java

Print this page




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.tools.jconsole;
  27 
  28 import java.awt.*;
  29 import java.awt.event.*;
  30 
  31 import javax.swing.*;
  32 
  33 @SuppressWarnings("serial")
  34 public class LabeledComponent extends JPanel {
  35     JPanel rightPanel;
  36     String labelStr, valueLabelStr, compoundStr;
  37     JLabel label;
  38     JComponent comp;
  39 
  40     public LabeledComponent(String text, JComponent comp) {
  41         this(text, 0, comp);
  42     }
  43 
  44     public LabeledComponent(String text, int mnemonic, JComponent comp) {
  45         super(new BorderLayout(6, 6));
  46 
  47         this.labelStr = text;
  48         this.label = new JLabel(text, JLabel.RIGHT);
  49         this.comp = comp;




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.tools.jconsole;
  27 
  28 import java.awt.*;

  29 
  30 import javax.swing.*;
  31 
  32 @SuppressWarnings("serial")
  33 public class LabeledComponent extends JPanel {
  34     JPanel rightPanel;
  35     String labelStr, valueLabelStr, compoundStr;
  36     JLabel label;
  37     JComponent comp;
  38 
  39     public LabeledComponent(String text, JComponent comp) {
  40         this(text, 0, comp);
  41     }
  42 
  43     public LabeledComponent(String text, int mnemonic, JComponent comp) {
  44         super(new BorderLayout(6, 6));
  45 
  46         this.labelStr = text;
  47         this.label = new JLabel(text, JLabel.RIGHT);
  48         this.comp = comp;