• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DefaultComponentFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.jgoodies.forms.factories.DefaultComponentFactory的典型用法代码示例。如果您正苦于以下问题:Java DefaultComponentFactory类的具体用法?Java DefaultComponentFactory怎么用?Java DefaultComponentFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultComponentFactory类属于com.jgoodies.forms.factories包,在下文中一共展示了DefaultComponentFactory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testLabelWithCustomAccessibleName

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
public static void testLabelWithCustomAccessibleName() {
    String text = "Name:";
    String accessibleName = "The name";
    JLabel label = DefaultComponentFactory.getInstance().createLabel(text);
    label.getAccessibleContext().setAccessibleName(accessibleName);
    testLabelAccessibleName("Label with custom accessible name",
            label,
            accessibleName);
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:10,代码来源:DefaultComponentFactoryTest.java


示例2: testLabelAccessibleName

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
private static void testLabelAccessibleName(
        String description,
        String text,
        String expected) {
    testLabelAccessibleName(
            description,
            DefaultComponentFactory.getInstance().createLabel(text),
            expected);
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:10,代码来源:DefaultComponentFactoryTest.java


示例3: getComponentFactory

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
public final ComponentFactory getComponentFactory()
{
  if (this.componentFactory == null) {
    this.componentFactory = DefaultComponentFactory.getInstance();
  }
  return this.componentFactory;
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:8,代码来源:PanelBuilder.java


示例4: createStyledSeparator

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
public static JComponent createStyledSeparator(String text, int style, ComponentOrientation orientation) {
	JLabel separatorLabel = new JLabel(text);
	separatorLabel.setFont(separatorLabel.getFont().deriveFont(style));
	separatorLabel.setHorizontalAlignment(orientation.isLeftToRight() ? SwingConstants.LEFT : SwingConstants.RIGHT);
	return DefaultComponentFactory.getInstance().createSeparator(separatorLabel);
}
 
开发者ID:DigitalMediaServer,项目名称:DigitalMediaServer,代码行数:7,代码来源:LooksFrame.java


示例5: createPanel

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
public JPanel createPanel() {
	JPanel jpanel1 = new JPanel();
	EmptyBorder emptyborder1 = new EmptyBorder(5, 5, 5, 5);
	jpanel1.setBorder(emptyborder1);
	FormLayout formlayout1 = new FormLayout(
			"FILL:25PX:NONE,FILL:DEFAULT:GROW(1.0)",
			"CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:20PX:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,FILL:PREF:GROW,CENTER:20PX:NONE,CENTER:DEFAULT:NONE");
	CellConstraints cc = new CellConstraints();
	jpanel1.setLayout(formlayout1);

	DefaultComponentFactory fac = DefaultComponentFactory.getInstance();

	titleStep1 = fac.createSeparator("Step 1");
	titleStep1.setName("titleStep1");
	jpanel1.add(titleStep1, cc.xywh(1, 1, 2, 1));

	titleStep2 = fac.createSeparator("Step 2");
	titleStep2.setName("titleStep2");
	jpanel1.add(titleStep2, cc.xywh(1, 5, 2, 1));

	txtName.setName("txtName");
	jpanel1.add(txtName, cc.xy(2, 3));

	JScrollPane paneDesc = new JScrollPane(txtDescription);
	jpanel1.add(paneDesc, cc.xy(2, 7));

	JLabel jlabel1 = new JLabel();
	jlabel1.setText("Enter a name for the new corpus:");
	jpanel1.add(jlabel1, cc.xy(2, 2));

	JLabel jlabel2 = new JLabel();
	jlabel2.setText("Enter a description for the new corpus:");
	jpanel1.add(jlabel2, cc.xy(2, 6));

	btnCreateCorpus.setActionCommand("Create");
	btnCreateCorpus.setName("btnCreateCorpus");
	btnCreateCorpus.setText("Ok");
	btnCreateCorpus.addActionListener(e -> {
		if(validateForm()) {
			wasCanceled = false;
			NewCorpusDialog.this.setVisible(false);
			NewCorpusDialog.this.dispose();
		}
	});
	btnCreateCorpus.setDefaultCapable(true);
	getRootPane().setDefaultButton(btnCreateCorpus);
	
	btnCancel.setActionCommand("Cancel");
	btnCancel.setName("btnCancel");
	btnCancel.setText("Cancel");
	btnCancel.addActionListener(e -> {
		wasCanceled = true;
		NewCorpusDialog.this.setVisible(false);
		NewCorpusDialog.this.dispose();
	});
	
	JComponent buttonBar = ButtonBarBuilder.buildOkCancelBar(btnCreateCorpus, btnCancel);
	
	jpanel1.add(buttonBar, cc.xyw(1, 9, 2));

	addFillComponents(jpanel1, new int[] { 2 }, new int[] { 2,3,4,6,7,8 });
	return jpanel1;
}
 
开发者ID:phon-ca,项目名称:phon,代码行数:64,代码来源:NewCorpusDialog.java


示例6: createPanel

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
public JPanel createPanel() {
	JPanel jpanel1 = new JPanel();
	EmptyBorder emptyborder1 = new EmptyBorder(5,5,5,5);
	jpanel1.setBorder(emptyborder1);
	FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:20PX:NONE,CENTER:DEFAULT:NONE");
	CellConstraints cc = new CellConstraints();
	jpanel1.setLayout(formlayout1);

	DefaultComponentFactory fac = DefaultComponentFactory.getInstance();
	JComponent titledseparator1 = fac.createSeparator("Step 1");
	jpanel1.add(titledseparator1,cc.xywh(1,1,2,1));

	JComponent titledseparator2 = fac.createSeparator("Step 2");
	jpanel1.add(titledseparator2,cc.xywh(1,5,2,1));

	JLabel jlabel1 = new JLabel();
	jlabel1.setText("Select the corpus you wish to rename:");
	jpanel1.add(jlabel1,cc.xy(2,2));

	JLabel jlabel3 = new JLabel();
	jlabel3.setText("Enter the new name for the corpus:");
	jpanel1.add(jlabel3,cc.xy(2,6));

	// Add existing corpora to combo box
	final List<String> corpora = project.getCorpora();
	for(String corpusName : corpora)
		cmbCorpus.addItem(corpusName);

	cmbCorpus.setName("cmbCorpus");
	jpanel1.add(cmbCorpus,cc.xy(2,3));

	txtName.setName("txtName");
	jpanel1.add(txtName,cc.xy(2,7));

	btnRenameCorpus.setActionCommand("Rename");
	btnRenameCorpus.setName("btnRenameCorpus");
	btnRenameCorpus.setText("Ok");
	btnRenameCorpus.addActionListener( e -> {
		if(!validateForm()) {
			ToastFactory.makeToast("Invalid characters in name").start(txtName);
			return;
		}
		wasCanceled = false;
		setVisible(false);
		dispose();
	});
	getRootPane().setDefaultButton(btnRenameCorpus);
	
	btnCancel.setActionCommand("Cancel");
	btnCancel.setName("btnCancel");
	btnCancel.setText("Cancel");
	btnCancel.addActionListener(e -> {
		wasCanceled = true;
		setVisible(false);
		dispose();
	});

	JComponent buttonBar = ButtonBarBuilder.buildOkCancelBar(btnRenameCorpus, btnCancel);
	jpanel1.add(buttonBar, cc.xyw(1, 9, 2));

	addFillComponents(jpanel1,new int[]{ 2 },new int[]{ 2,3,4,6,7,8 });
	return jpanel1;
}
 
开发者ID:phon-ca,项目名称:phon,代码行数:64,代码来源:RenameCorpusDialog.java


示例7: createPanel

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
public JPanel createPanel() {
		JPanel jpanel1 = new JPanel();
		FormLayout formlayout1 = new FormLayout(
				"CENTER:25PX:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE",
				"CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:20PX:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:20PX:NONE,CENTER:DEFAULT:NONE");
		CellConstraints cc = new CellConstraints();
		jpanel1.setLayout(formlayout1);
		jpanel1.setBorder(new EmptyBorder(5, 5, 5, 5));

		DefaultComponentFactory fac = DefaultComponentFactory.getInstance();

		JComponent titledseparator1 = fac.createSeparator("Step 1");
		jpanel1.add(titledseparator1, cc.xywh(1, 1, 3, 1));

		JComponent titledseparator2 = fac.createSeparator("Step 2");
		jpanel1.add(titledseparator2, cc.xywh(1, 5, 3, 1));

		JLabel jlabel1 = new JLabel();
		jlabel1.setText("Enter a name for the new session:");
		jpanel1.add(jlabel1, cc.xywh(2, 2, 2, 1));

		txtName.setName("txtName");
		jpanel1.add(txtName, cc.xywh(2, 3, 2, 1));

		cmbCorpus.setName("cmbCorpus");
		jpanel1.add(cmbCorpus, cc.xy(2, 7));

//			ImageFactory imgFactory = ImageFactory.getInstance();
//			ImageIcon im = new ImageIcon(imgFactory.getImage("new_corpus", 16, 16));
		ImageIcon im = IconManager.getInstance().getIcon(
				"actions/list-add", IconSize.SMALL);
		btnCreateCorpus.setIcon(im);
		btnCreateCorpus.setName("btnCreateCorpus");
		btnCreateCorpus.addActionListener(new CreateCorpusListener());
		jpanel1.add(btnCreateCorpus, cc.xy(3, 7));

		JLabel jlabel2 = new JLabel();
		jlabel2.setText("Select a corpus to use for this session:");
		jpanel1.add(jlabel2, cc.xy(2, 6));

		addFillComponents(jpanel1, new int[] { 2,3 }, new int[] { 2,3,4,6,7,8 });
		return jpanel1;
	}
 
开发者ID:phon-ca,项目名称:phon,代码行数:44,代码来源:NewSessionPanel.java


示例8: addROLabel

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
/**
 * Adds a textual label intended for labeling read-only components
 * to the form using the specified constraints.<p>
 *
 * <pre>
 * addROLabel("Name:",       cc.xy(1, 1)); // No Mnemonic
 * addROLabel("N&ame:",      cc.xy(1, 1)); // Mnemonic is 'a'
 * addROLabel("Save &as:",   cc.xy(1, 1)); // Mnemonic is the second 'a'
 * addROLabel("Look&&Feel:", cc.xy(1, 1)); // No mnemonic, text is "look&feel"
 * </pre>
 *
 * @param textWithMnemonic  the label's text -
 *     may contain an ampersand (<tt>&amp;</tt>) to mark a mnemonic
 * @param constraints       the label's cell constraints
 * @return the new label
 *
 * @see ComponentFactory2
 *
 * @since 1.3
 */
public final JLabel addROLabel(String textWithMnemonic, CellConstraints constraints) {
    ComponentFactory factory = getComponentFactory();
    ComponentFactory2 factory2;
    if (factory instanceof ComponentFactory2) {
        factory2 = (ComponentFactory2) factory;
    } else {
        factory2 = DefaultComponentFactory.getInstance();
    }
    JLabel label = factory2.createReadOnlyLabel(textWithMnemonic);
    add(label, constraints);
    return label;
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:33,代码来源:PanelBuilder.java


示例9: getComponentFactory

import com.jgoodies.forms.factories.DefaultComponentFactory; //导入依赖的package包/类
/**
 * Returns the builder's component factory. If no factory
 * has been set before, it is lazily initialized using with an instance of
 * {@link com.jgoodies.forms.factories.DefaultComponentFactory}.
 *
 * @return the component factory
 *
 * @see #setComponentFactory(ComponentFactory)
 */
public final ComponentFactory getComponentFactory() {
    if (componentFactory == null) {
        componentFactory = DefaultComponentFactory.getInstance();
    }
    return componentFactory;
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:16,代码来源:PanelBuilder.java



注:本文中的com.jgoodies.forms.factories.DefaultComponentFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Protocol类代码示例发布时间:2022-05-23
下一篇:
Java FailedNodeException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap