本文整理汇总了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;未经允许,请勿转载。 |
请发表评论