本文整理汇总了Java中javax.swing.JTextArea.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Java JTextArea.setBounds方法的具体用法?Java JTextArea.setBounds怎么用?Java JTextArea.setBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTextArea
的用法示例。
在下文中一共展示了JTextArea.setBounds方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WindowGame
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* Create the frame.
*/
public WindowGame() {
setIconImage(Toolkit.getDefaultToolkit().getImage(WindowGame.class.getResource("/resource/chip.png")));
setTitle("\u6A4B\u724C123");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 980, 500);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
textField = new JTextField();
textField.setBounds(650, 422, 239, 29);
contentPane.add(textField);
textField.setColumns(10);
JButton btnNewButton = new JButton("\u50B3\u9001");
btnNewButton.setBounds(886, 422, 68, 29);
contentPane.add(btnNewButton);
JTextArea textArea = new JTextArea();
textArea.setBounds(650, 0, 304, 423);
contentPane.add(textArea);
}
示例2: InfoPage
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* Create the application.
*/
public InfoPage() {
setBounds(100, 100, 450, 300);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
{
JLabel lblInstructions = new JLabel("INFORMATION");
lblInstructions.setFont(new Font("Lucida Grande", Font.BOLD, 40));
lblInstructions.setHorizontalAlignment(SwingConstants.CENTER);
lblInstructions.setBounds(70, 6, 325, 48);
contentPanel.add(lblInstructions);
}
JTextArea txtrTest = new JTextArea();
txtrTest.setText("Rule 1:\n\nRule 2:\n\nRule 3:\n\nRule 4:\n\nRule 5:\n\nRule 6:\n\nRule 7:\n……..");
txtrTest.setBounds(17, 52, 415, 181);
txtrTest.setEditable(false);
txtrTest.setAutoscrolls(true);
contentPanel.add(txtrTest);
}
示例3: JWindow
import javax.swing.JTextArea; //导入方法依赖的package包/类
public JWindow(String name)
{
super(name);
panel = new MyPanel(this);
this.setContentPane(panel);
setPreferredSize(log_box);
setAlwaysOnTop(true);
setVisible(true);
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
paintText = new ArrayList<String>();
setLayout(null);
button_launch = new JButton("LAUNCH");
button_launch.addActionListener(this);
add(button_launch);
button_abort = new JButton("ABORT");
button_abort.addActionListener(this);
button_abort.setBounds(300, 0, 100, 220);
Dimension size = new Dimension();
size.width = 200;
size.height = 86;
Dimension pos = new Dimension(190, 100);
button_launch.setBounds(pos.width-Math.round(size.width/2f), pos.height-Math.round(size.height/2f), size.width, size.height);
text_ap = new JTextArea("75000");
text_ap.setBounds(105, 170, 170, 15);
add(text_ap);
pack();
}
示例4: StartPagePanel
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* Create the panel.
*/
public StartPagePanel() {
setLayout(null);
btnNewButton = new JButton("Play");
btnNewButton.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
btnNewButton.setBounds(141, 84, 149, 52);
add(btnNewButton);
btnMakeDeck = new JButton("Make Deck");
btnMakeDeck.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
btnMakeDeck.setBounds(141, 144, 149, 52);
add(btnMakeDeck);
btnOpenPack = new JButton("Open Pack");
btnOpenPack.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
btnOpenPack.setEnabled(false);
btnOpenPack.setBounds(141, 208, 149, 52);
add(btnOpenPack);
JLabel lblHearthstone = new JLabel("Hearthstone");
lblHearthstone.setFont(new Font("Lucida Grande", Font.PLAIN, 30));
lblHearthstone.setBounds(131, 32, 178, 36);
add(lblHearthstone);
lblWelcome = new JLabel("Welcome, ");
lblWelcome.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
lblWelcome.setBounds(391, 100, 224, 25);
add(lblWelcome);
lblYouAreRank = new JLabel("You are rank ");
lblYouAreRank.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
lblYouAreRank.setBounds(391, 142, 265, 25);
add(lblYouAreRank);
JLabel lblYouHave = new JLabel("You have ");
lblYouHave.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
lblYouHave.setBounds(391, 173, 224, 25);
add(lblYouHave);
JTextArea txtrAllPropertiesBelong = new JTextArea();
txtrAllPropertiesBelong.setText("All properties belong to their respective owners.\nDeveloped by Imran Khaliq.");
txtrAllPropertiesBelong.setBounds(391, 262, 303, 32);
txtrAllPropertiesBelong.setBackground(this.getBackground());
add(txtrAllPropertiesBelong);
btnLogout = new JButton("Logout");
btnLogout.setBounds(6, 265, 117, 29);
add(btnLogout);
btnCollection = new JButton("Collection");
btnCollection.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
btnCollection.setBounds(466, 208, 149, 52);
add(btnCollection);
}
示例5: ProhibitedWordList
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* Create the dialog.
*/
public ProhibitedWordList() {
setBounds(100, 100, 450, 768);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
JLabel prohibitedWords = new JLabel("Prohibited Words");
prohibitedWords.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
prohibitedWords.setHorizontalAlignment(SwingConstants.CENTER);
prohibitedWords.setBounds(95, 6, 221, 25);
contentPanel.add(prohibitedWords);
JTextArea wordList = new JTextArea();
wordList.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
wordList.setBounds(29, 43, 403, 687);
wordList.setText(" 1.. Scrum \n" +
" 2. Daily scrum \n" +
" 3. Scrum of scrums \n" +
" 4. Scrum master \n" +
" 5. Product owner \n" +
" 6. Team member \n" +
" 7. Story point \n" +
" 8. Value \n" +
" 9. Estimation \n" +
" 10. Sprint Retrospective \n" +
" 11. Sprint Review \n" +
" 12. Sprint Planning \n" +
" 13. Sprint \n" +
" 14. I teration \n" +
" 15. Epic \n" +
" 16. Spike \n" +
" 17. Sprint Backlog \n" +
" 18. Product Backlog \n" +
" 19. Backlog Grooming \n" +
" 20. Effort \n" +
" 21. Ideal work day \n" +
" 22. Simple story \n" +
" 23. Compound story \n" +
" 24. Unknowns \n" +
" 25. Knowns \n" +
" 26. Kanban \n" +
" 27. eXtreme Programming");
contentPanel.add(wordList);
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane, BorderLayout.SOUTH);
}
}
示例6: DialogFrame
import javax.swing.JTextArea; //导入方法依赖的package包/类
public DialogFrame() {
setType(Type.POPUP);
setResizable(false);
setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
this.setTitle("Approving question");
this.setPreferredSize(new Dimension(400, 190));
this.setAlwaysOnTop(isAlwaysOnTopSupported());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
getContentPane().setLayout(new BorderLayout());
final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(screenSize.width / 2 - 150, screenSize.height / 2 - 75);
this.setIconImage(Toolkit.getDefaultToolkit().
getImage(getClass().getResource(LOGOPATH)));
final JPanel panel = new JPanel();
panel.setAutoscrolls(true);
getContentPane().add(panel, BorderLayout.CENTER);
panel.setLayout(null);
btnYes = new JButton("YES");
btnYes.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
btnYes.setBounds(291, 129, 91, 29);
panel.add(btnYes);
btnNo = new JButton("NO");
btnNo.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
btnNo.setBounds(199, 129, 91, 29);
panel.add(btnNo);
lblIcon = new JLabel("");
lblIcon.setIcon(new ImageIcon(DialogFrame.class.getResource("/com/coder/hms/icons/dialogPane_question.png")));
lblIcon.setBounds(14, 40, 69, 70);
panel.add(lblIcon);
textArea = new JTextArea();
textArea.setDisabledTextColor(new Color(153, 204, 255));
textArea.setBounds(95, 32, 287, 85);
textArea.setBackground(UIManager.getColor("ComboBox.background"));
textArea.setBorder(null);
textArea.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
textArea.setEditable(false);
textArea.setFont(new Font("Monospaced", Font.PLAIN, 14));
textArea.setLineWrap(true);
panel.add(textArea);
this.pack();
}
示例7: GameUI
import javax.swing.JTextArea; //导入方法依赖的package包/类
/**
* Create the frame.
*/
public GameUI(GameRunnerMVC controller) {
this.controller = controller;
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 491, 426);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
textArea = new JTextArea();
textArea.setLineWrap(true);
textArea.setBounds(10, 25, 455, 196);
textArea.setText("");
contentPane.add(textArea);
textPane1 = new JTextPane();
textPane1.setBounds(10, 0, 149, 20);
textPane1.setText("Health: 50");
contentPane.add(textPane1);
textPane2 = new JTextPane();
textPane2.setBounds(169, 0, 134, 20);
textPane2.setText("Money: 50");
contentPane.add(textPane2);
textPane3 = new JTextPane();
textPane3.setBounds(313, 0, 134, 20);
textPane3.setText("Satisfaction: 50");
contentPane.add(textPane3);
button1 = new JButton("");
button1.setFont(new Font("Tahoma", Font.PLAIN, 11));
button1.setBounds(10, 230, 222, 40);
contentPane.add(button1);
button2 = new JButton("");
button2.setBounds(243, 230, 222, 40);
contentPane.add(button2);
button3 = new JButton("");
button3.setBounds(10, 281, 222, 40);
contentPane.add(button3);
button4 = new JButton("");
button4.setBounds(243, 281, 222, 40);
contentPane.add(button4);
button5 = new JButton("");
button5.setBounds(10, 332, 222, 40);
contentPane.add(button5);
button6 = new JButton("");
button6.setBounds(243, 332, 222, 40);
contentPane.add(button6);
}