|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.debugger.jpda.ui; import org.openide.util.NbBundle; import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.border.CompoundBorder; import java.util.*; import java.awt.BorderLayout; /** * A GUI panel for customizing a Watch. * @author Maros Sandor */ public class WatchPanel { private JPanel panel; private JTextField textField; private String expression; public WatchPanel(String expression) { this.expression = expression; } public JComponent getPanel() { if (panel != null) return panel; panel = new JPanel(); ResourceBundle bundle = NbBundle.getBundle(WatchPanel.class); panel.getAccessibleContext ().setAccessibleDescription (bundle.getString ("ACSD_WatchPanel")); // NOI18N JLabel textLabel = new JLabel (bundle.getString ("CTL_Watch_Name")); // NOI18N textLabel.setBorder (new EmptyBorder (0, 0, 0, 10)); panel.setLayout (new BorderLayout ()); panel.setBorder (new EmptyBorder (11, 12, 1, 11)); panel.add ("West", textLabel); // NOI18N panel.add ("Center", textField = new JTextField (25)); // NOI18N textField.getAccessibleContext ().setAccessibleDescription (bundle.getString ("ACSD_CTL_Watch_Name")); // NOI18N textField.setBorder ( new CompoundBorder (textField.getBorder (), new EmptyBorder (2, 0, 2, 0)) ); textLabel.setDisplayedMnemonic ( bundle.getString ("CTL_Watch_Name_Mnemonic").charAt (0) // NOI18N ); textField.setText (expression); textField.selectAll (); textLabel.setLabelFor (textField); textField.requestFocus (); return panel; } public String getExpression() { return textField.getText().trim(); } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.