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

Java FocusTraversalOnArray类代码示例

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

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



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

示例1: EditorFrame

import org.eclipse.wb.swing.FocusTraversalOnArray; //导入依赖的package包/类
public EditorFrame() {
	System.out.println("Creating UI components");
	JFrame f = new JFrame(EditorFrame.class.getName());
	f.setExtendedState(JFrame.MAXIMIZED_BOTH); 
       DefaultSyntaxKit.initKit();
       try {
		UIManager.setLookAndFeel(
		        UIManager.getSystemLookAndFeelClassName());
		//UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
	} catch (ClassNotFoundException | InstantiationException
			| IllegalAccessException | UnsupportedLookAndFeelException e1) {
		// TODO Auto-generated catch block
		e1.printStackTrace();
	}
       //System.out.print(DefaultSyntaxKit.EndOfLineStringProperty);

       codeEditor = new JEditorPane();
       
       JMenuBar myBar = new JMenuBar();
       JMenu myMenu = getFileMenu();
       myBar.add(myMenu); 
       f.setJMenuBar(myBar);
       f.setTitle("Speech Coder");
       JScrollPane scrPane = new JScrollPane(codeEditor);
       
       
       
       
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	contentPane.setLayout(new BorderLayout(0, 0));
	f.setContentPane(contentPane);
	
	JSplitPane splitPane = new JSplitPane();
	splitPane.setOneTouchExpandable(true);
	splitPane.setResizeWeight(0.18);
	contentPane.add(splitPane, BorderLayout.CENTER);
	
	JSplitPane splitPane_1 = new JSplitPane();
	splitPane_1.setOneTouchExpandable(true);
	splitPane_1.setOrientation(JSplitPane.VERTICAL_SPLIT);
	splitPane.setLeftComponent(splitPane_1);
	splitPane.setRightComponent(scrPane);
	
	consoleTextArea = new JTextArea(50,10);
	setCustomConsole(consoleTextArea);
	JScrollPane scrPane1 = new JScrollPane(consoleTextArea);
	
	//formatting
	consoleTextArea.setBackground(Color.BLACK);
	consoleTextArea.setForeground(Color.LIGHT_GRAY);
	
	splitPane_1.setRightComponent(scrPane1);
	
	JButton btnStartButton = new JButton("Speech Recognition mode");
	btnStartButton.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e) {
			System.out.println("Starting coder now");
			consoleTextArea.setText("");
			startCoder();
			
		}
	});
	splitPane_1.setLeftComponent(btnStartButton);
	contentPane.setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{splitPane}));
	
	codeEditor.setContentType("text/java");
    //codeEditor.setText(code);
        
        
    f.setSize(800,600);
    f.setVisible(true);
    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    
}
 
开发者ID:CMPE272Project,项目名称:SpeakJava,代码行数:76,代码来源:EditorFrame.java


示例2: RaffleErrorPopup

import org.eclipse.wb.swing.FocusTraversalOnArray; //导入依赖的package包/类
/**
 * Create the dialog.
 */
public RaffleErrorPopup(String msg) {
    Main.logger.info("Creating raffle error popup");
    setIconImage(Toolkit.getDefaultToolkit().getImage(RaffleErrorPopup.class.getResource("/templates/error.png")));
    setTitle("Error");
    setBounds(100, 100, 450, 300);
    getContentPane().setLayout(new BorderLayout());
    JPanel contentPanel = new JPanel();
    contentPanel.setLayout(new FlowLayout());
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    contentPanel.setOpaque(false);
    getContentPane().add(contentPanel, BorderLayout.CENTER);

    {
        JPanel panel = new IconPanel();
        contentPanel.add(panel);
    }

    {
        JTextPane textPane = new JTextPane();
        textPane.setText(msg);
        textPane.setOpaque(false);
        textPane.setEditable(false);
        contentPanel.add(textPane);
    }

    {
        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new FlowLayout(FlowLayout.CENTER));
        getContentPane().add(buttonPane, BorderLayout.SOUTH);

        JButton okButton;
        {
            okButton = new JButton("OK");
            Action okAction = new OKAction();
            okButton.setAction(okAction);
            okButton.setActionCommand("OK");
            buttonPane.add(okButton);
            getRootPane().setDefaultButton(okButton);
        }

        buttonPane.setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{okButton}));
    }

    this.pack();
    go();
}
 
开发者ID:GazLloyd,项目名称:RaffleGrabber,代码行数:50,代码来源:RaffleErrorPopup.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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