Java Code Examples for java.awt.TextArea#SCROLLBARS_NONE
The following examples show how to use
java.awt.TextArea#SCROLLBARS_NONE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SelectionVisible.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Override public void init() { ta = new TextArea(4, 20); ta.setText("01234\n56789"); ta.select(3, 9); final TextArea instruction = new TextArea("INSTRUCTIONS:\n" + "The text 34567 should be selected in the TextArea.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); instruction.setEditable(false); instruction.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(ta); setLayout(new BorderLayout()); add(instruction, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 2
Source File: LWTextAreaPeer.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private void setScrollBarVisibility(final int visibility) { final ScrollableJTextArea pane = getDelegate(); final JTextArea view = pane.getView(); view.setLineWrap(false); switch (visibility) { case TextArea.SCROLLBARS_NONE: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); view.setLineWrap(true); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); view.setLineWrap(true); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); break; default: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); break; } }
Example 3
Source File: SelectionVisible.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
@Override public void init() { tf = new TextField(20); tf.setText("0123456789"); tf.select(0, 6); final TextArea ta = new TextArea("INSTRUCTIONS:\n" + "The text 012345 should be selected in the TextField.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); ta.setEditable(false); ta.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(tf); setLayout(new BorderLayout()); add(ta, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 4
Source File: SelectionVisible.java From hottub with GNU General Public License v2.0 | 6 votes |
@Override public void init() { ta = new TextArea(4, 20); ta.setText("01234\n56789"); ta.select(3, 9); final TextArea instruction = new TextArea("INSTRUCTIONS:\n" + "The text 34567 should be selected in the TextArea.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); instruction.setEditable(false); instruction.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(ta); setLayout(new BorderLayout()); add(instruction, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 5
Source File: SelectionVisible.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Override public void init() { tf = new TextField(20); tf.setText("0123456789"); tf.select(0, 6); final TextArea ta = new TextArea("INSTRUCTIONS:\n" + "The text 012345 should be selected in the TextField.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); ta.setEditable(false); ta.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(tf); setLayout(new BorderLayout()); add(ta, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 6
Source File: LWTextAreaPeer.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private void setScrollBarVisibility(final int visibility) { final ScrollableJTextArea pane = getDelegate(); final JTextArea view = pane.getView(); view.setLineWrap(false); switch (visibility) { case TextArea.SCROLLBARS_NONE: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); view.setLineWrap(true); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); view.setLineWrap(true); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); break; default: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); break; } }
Example 7
Source File: SelectionVisible.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@Override public void init() { tf = new TextField(20); tf.setText("0123456789"); tf.select(0, 6); final TextArea ta = new TextArea("INSTRUCTIONS:\n" + "The text 012345 should be selected in the TextField.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); ta.setEditable(false); ta.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(tf); setLayout(new BorderLayout()); add(ta, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 8
Source File: SelectionVisible.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@Override public void init() { ta = new TextArea(4, 20); ta.setText("01234\n56789"); ta.select(3, 9); final TextArea instruction = new TextArea("INSTRUCTIONS:\n" + "The text 34567 should be selected in the TextArea.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); instruction.setEditable(false); instruction.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(ta); setLayout(new BorderLayout()); add(instruction, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 9
Source File: LWTextAreaPeer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private void setScrollBarVisibility(final int visibility) { final ScrollableJTextArea pane = getDelegate(); final JTextArea view = pane.getView(); view.setLineWrap(false); switch (visibility) { case TextArea.SCROLLBARS_NONE: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); view.setLineWrap(true); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); view.setLineWrap(true); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); break; default: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); break; } }
Example 10
Source File: SelectionVisible.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Override public void init() { tf = new TextField(20); tf.setText("0123456789"); tf.select(0, 6); final TextArea ta = new TextArea("INSTRUCTIONS:\n" + "The text 012345 should be selected in the TextField.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); ta.setEditable(false); ta.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(tf); setLayout(new BorderLayout()); add(ta, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 11
Source File: LWTextAreaPeer.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
private void setScrollBarVisibility(final int visibility) { final ScrollableJTextArea pane = getDelegate(); final JTextArea view = pane.getView(); view.setLineWrap(false); switch (visibility) { case TextArea.SCROLLBARS_NONE: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); view.setLineWrap(true); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); view.setLineWrap(true); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); break; default: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); break; } }
Example 12
Source File: LWTextAreaPeer.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void setScrollBarVisibility(final int visibility) { final ScrollableJTextArea pane = getDelegate(); final JTextArea view = pane.getView(); view.setLineWrap(false); switch (visibility) { case TextArea.SCROLLBARS_NONE: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); view.setLineWrap(true); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); view.setLineWrap(true); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); break; default: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); break; } }
Example 13
Source File: LWTextAreaPeer.java From hottub with GNU General Public License v2.0 | 6 votes |
private void setScrollBarVisibility(final int visibility) { final ScrollableJTextArea pane = getDelegate(); final JTextArea view = pane.getView(); view.setLineWrap(false); switch (visibility) { case TextArea.SCROLLBARS_NONE: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); view.setLineWrap(true); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); view.setLineWrap(true); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); break; default: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); break; } }
Example 14
Source File: SelectionVisible.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
@Override public void init() { ta = new TextArea(4, 20); ta.setText("01234\n56789"); ta.select(3, 9); final TextArea instruction = new TextArea("INSTRUCTIONS:\n" + "The text 34567 should be selected in the TextArea.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); instruction.setEditable(false); instruction.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(ta); setLayout(new BorderLayout()); add(instruction, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 15
Source File: SelectionVisible.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
@Override public void init() { tf = new TextField(20); tf.setText("0123456789"); tf.select(0, 6); final TextArea ta = new TextArea("INSTRUCTIONS:\n" + "The text 012345 should be selected in the TextField.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); ta.setEditable(false); ta.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(tf); setLayout(new BorderLayout()); add(ta, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 16
Source File: SelectionVisible.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Override public void init() { ta = new TextArea(4, 20); ta.setText("01234\n56789"); ta.select(3, 9); final TextArea instruction = new TextArea("INSTRUCTIONS:\n" + "The text 34567 should be selected in the TextArea.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); instruction.setEditable(false); instruction.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(ta); setLayout(new BorderLayout()); add(instruction, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 17
Source File: SelectionVisible.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
@Override public void init() { ta = new TextArea(4, 20); ta.setText("01234\n56789"); ta.select(3, 9); final TextArea instruction = new TextArea("INSTRUCTIONS:\n" + "The text 34567 should be selected in the TextArea.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); instruction.setEditable(false); instruction.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(ta); setLayout(new BorderLayout()); add(instruction, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 18
Source File: LWTextAreaPeer.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void setScrollBarVisibility(final int visibility) { final ScrollableJTextArea pane = getDelegate(); final JTextArea view = pane.getView(); view.setLineWrap(false); switch (visibility) { case TextArea.SCROLLBARS_NONE: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); view.setLineWrap(true); break; case TextArea.SCROLLBARS_VERTICAL_ONLY: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); view.setLineWrap(true); break; case TextArea.SCROLLBARS_HORIZONTAL_ONLY: pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); break; default: pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); break; } }
Example 19
Source File: SelectionVisible.java From hottub with GNU General Public License v2.0 | 6 votes |
@Override public void init() { tf = new TextField(20); tf.setText("0123456789"); tf.select(0, 6); final TextArea ta = new TextArea("INSTRUCTIONS:\n" + "The text 012345 should be selected in the TextField.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); ta.setEditable(false); ta.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(tf); setLayout(new BorderLayout()); add(ta, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }
Example 20
Source File: SelectionVisible.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
@Override public void init() { ta = new TextArea(4, 20); ta.setText("01234\n56789"); ta.select(3, 9); final TextArea instruction = new TextArea("INSTRUCTIONS:\n" + "The text 34567 should be selected in the TextArea.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); instruction.setEditable(false); instruction.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); panel.add(ta); setLayout(new BorderLayout()); add(instruction, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); }