當前位置: 首頁>>代碼示例>>Java>>正文


Java JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS屬性代碼示例

本文整理匯總了Java中javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS屬性的典型用法代碼示例。如果您正苦於以下問題:Java JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS屬性的具體用法?Java JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS怎麽用?Java JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.swing.JScrollPane的用法示例。


在下文中一共展示了JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showDetails

private static void showDetails(RunningVM vm) {
    HTMLTextArea area = new HTMLTextArea();
    JScrollPane areaScroll = new JScrollPane(area, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                                   JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    areaScroll.setBorder(BorderFactory.createEmptyBorder());
    areaScroll.setViewportBorder(BorderFactory.createEmptyBorder());
    areaScroll.setPreferredSize(new Dimension(500, 260));
    configureScrollBar(areaScroll.getVerticalScrollBar());
    configureScrollBar(areaScroll.getHorizontalScrollBar());
    
    area.setText(getDetails(vm));
    area.setCaretPosition(0);
    
    HelpCtx helpCtx = new HelpCtx("ProcessDetails.HelpCtx"); //NOI18N
    JButton close = new JButton(Bundle.AttachDialog_BtnClose());
    close.setDefaultCapable(true);
    DialogDescriptor dd = new DialogDescriptor(areaScroll, Bundle.AttachDialog_DetailsCaption(getProcessName(vm.getMainClass())),
                          true, new Object[] { close }, close, DialogDescriptor.DEFAULT_ALIGN, helpCtx, null);
    Dialog d = DialogDisplayer.getDefault().createDialog(dd);
    d.pack();
    d.setVisible(true);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:AttachDialog.java

示例2: getOutputPanel

private JPanel getOutputPanel(JTextArea area) {
	JPanel panel = getNewPanel();

	JScrollPane areapane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

	GridBagConstraints g = new GridBagConstraints();

	areapane.setViewportView(area);

	g.gridx = 0;
	g.gridy = 1;
	g.weightx = 1;
	g.weighty = 1;
	g.fill = GridBagConstraints.BOTH;
	panel.add(areapane, g);
	
	return panel;
}
 
開發者ID:privacyint,項目名稱:thornsec-core,代碼行數:18,代碼來源:FullFrame.java

示例3: createAndShow

public void createAndShow() throws Exception{
    Preferences Config = TEdit.getConfig();
    JTextArea area = new JTextArea(10,40);
    area.setEditable(false);
              String Font_Name =  Config.get("FONT_NAME","Monospaced");
              int Font_Size = Config.getInt("FONT_SIZE",12);
              int Font_Style = Config.getInt("FONT_STYLE",Font.PLAIN);
              area.setFont(new Font(Font_Name,Font_Style,Font_Size));
              	JScrollPane scroll = new JScrollPane(area,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
		this.add(scroll,BorderLayout.CENTER);
                if(txt == null){
                    BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("org/ioblako/edit/resources/Help.txt"), "UTF-8"));
                     for (int c = br.read(); c != -1; c = br.read()) sb.append((char)c);
                     txt=sb.toString();
                }
                
                area.setText(txt);
                this.setTitle("Help");
                this.pack();
                this.setVisible(true);
               
}
 
開發者ID:mathhobbit,項目名稱:EditCalculateAndChart,代碼行數:22,代碼來源:HelpFrame.java

示例4: getView

public JComponent getView() {
  if (theMap == null) {
    theMap = new View(this);
    scroll = new AdjustableSpeedScrollPane(
          theMap,
          JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
          JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    scroll.unregisterKeyboardAction(KeyStroke.getKeyStroke(
          KeyEvent.VK_PAGE_DOWN, 0));
    scroll.unregisterKeyboardAction(KeyStroke.getKeyStroke(
          KeyEvent.VK_PAGE_UP, 0));

    layeredPane.setLayout(new InsetLayout(layeredPane, scroll));
    layeredPane.add(scroll, JLayeredPane.DEFAULT_LAYER);
  }
  return theMap;
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:17,代碼來源:PrivateMap.java

示例5: getHorizontalScrollBarPolicy

@Override
public int getHorizontalScrollBarPolicy() {
    if (horizontalScrollBarIsNeeded) {
        return JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS;
    } else {
        return super.getHorizontalScrollBarPolicy();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:OutlineView.java

示例6: fillJTextArea

private void fillJTextArea() {
	this.jtaResults = new JTextArea(27, 60);
	this.jtaResults.setText(results);
	this.jtaResults.setEditable(false);
	jspTextArea = new JScrollPane(jtaResults, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
	
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:7,代碼來源:PanelResults.java

示例7: createConsoleScrollPane

private static JScrollPane createConsoleScrollPane()
{
	JTextArea textArea = new JTextArea();
	textArea.setEditable(false);
	TextAreaOutputStream textAreaOutputStream = new TextAreaOutputStream(textArea);
	PrintStream textAreaPrintStream = new PrintStream(textAreaOutputStream);
	System.setOut(textAreaPrintStream);
	System.setErr(textAreaPrintStream);
	return new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
}
 
開發者ID:arjunvnair,項目名稱:ArJ-class-editor,代碼行數:10,代碼來源:ArJClassEditor.java

示例8: AutoCompletePopupWindow

/**
 * Constructor.
 *
 * @param parent The parent window (hosting the text component).
 * @param ac The auto-completion instance.
 */
public AutoCompletePopupWindow(Window parent, final AutoCompletion ac) {

	super(parent);
	ComponentOrientation o = ac.getTextComponentOrientation();

	this.ac = ac;
	model = new CompletionListModel();
	list = new PopupList(model);

	list.setCellRenderer(new DelegatingCellRenderer());
	list.addListSelectionListener(this);
	list.addMouseListener(this);

	JPanel contentPane = new JPanel(new BorderLayout());
	JScrollPane sp = new JScrollPane(list,
						JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
						JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

	// In 1.4, JScrollPane.setCorner() has a bug where it won't accept
	// JScrollPane.LOWER_TRAILING_CORNER, even though that constant is
	// defined.  So we have to put the logic added in 1.5 to handle it
	// here.
	JPanel corner = new SizeGrip();
	//sp.setCorner(JScrollPane.LOWER_TRAILING_CORNER, corner);
	boolean isLeftToRight = o.isLeftToRight();
    String str = isLeftToRight ? JScrollPane.LOWER_RIGHT_CORNER :
    								JScrollPane.LOWER_LEFT_CORNER;
    sp.setCorner(str, corner);

	contentPane.add(sp);
	setContentPane(contentPane);
	applyComponentOrientation(o);

	// Give apps a chance to decorate us with drop shadows, etc.
	if (Util.getShouldAllowDecoratingMainAutoCompleteWindows()) {
		PopupWindowDecorator decorator = PopupWindowDecorator.get();
		if (decorator!=null) {
			decorator.decorate(this);
		}
	}

	pack();

	setFocusableWindowState(false);

	lastLine = -1;

}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:54,代碼來源:AutoCompletePopupWindow.java


注:本文中的javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。