本文整理汇总了Java中java.awt.Component.setName方法的典型用法代码示例。如果您正苦于以下问题:Java Component.setName方法的具体用法?Java Component.setName怎么用?Java Component.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Component
的用法示例。
在下文中一共展示了Component.setName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareModel
import java.awt.Component; //导入方法依赖的package包/类
private void prepareModel() {
TabData[] td = new TabData[25];
int ct = 0;
for (char c='a'; c < 'z'; c++) {
char[] ch = new char[ct+1];
Arrays.fill (ch, c);
String name = new String (ch);
Component comp = new JLabel(name);
comp.setName (name);
td[ct] = new TabData (comp, ic, name, "tip:"+name);
ct++;
}
padX = 2;
padY = 2;
mdl = new DefaultTabDataModel (td);
JLabel jl = new JLabel();
jl.setBorder (BorderFactory.createEmptyBorder());
lay = new TestLayoutModel (mdl, jl);
lay.setPadding (new Dimension(padX, padY));
}
示例2: prepareModel
import java.awt.Component; //导入方法依赖的package包/类
private void prepareModel() {
if (mdl != null) {
mdl.removeComplexListDataListener(this);
}
TabData[] td = new TabData[25];
int ct = 0;
for (char c='a'; c < 'z'; c++) {
String name = new String (new char[]{c});
Component comp = new JLabel(name);
comp.setName (name);
td[ct] = new TabData (comp, ic, name, "tip:"+name);
ct++;
}
mdl = new DefaultTabDataModel (td);
}
示例3: createPreviousButton
import java.awt.Component; //导入方法依赖的package包/类
protected Component createPreviousButton() {
Component c = new BasicArrowButton(SwingConstants.SOUTH);
c.setName("Spinner.previousButton");
installPreviousButtonListeners(c);
return c;
}
示例4: getComponent
import java.awt.Component; //导入方法依赖的package包/类
@Override
public Component getComponent() {
Component component = super.getComponent();
component.setName( NbBundle.getMessage(ProgrammerDebuggerSelectionStep.class, "ProgrammerDebuggerSelectionPanel.title") );
return component;
}