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


Java BorderLayout.setVgap方法代碼示例

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


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

示例1: ObjectNameInputPanel

import java.awt.BorderLayout; //導入方法依賴的package包/類
/** Constructs panel. */
public ObjectNameInputPanel () {
  BorderLayout layout = new BorderLayout();
  layout.setVgap(5);
  layout.setHgap(5);
  setLayout(layout);
        
  // label and text field with mnemonic
  String labelText = I18nUtil.getBundle().getString ("LBL_TemplateName");
  JLabel label = new JLabel();
  Mnemonics.setLocalizedText(label, labelText);
  text = new JTextField();
  text.getAccessibleContext().setAccessibleDescription(I18nUtil.getBundle().getString ("ACS_TEXT_ObjectNameInputPanel"));
        
  label.setLabelFor(text);
        
  add(BorderLayout.WEST, label);
  add(BorderLayout.CENTER, text);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:SelectorUtils.java

示例2: initialize

import java.awt.BorderLayout; //導入方法依賴的package包/類
/**
 * This method initializes this
 * @return void
 */
private void initialize() {
	
	BorderLayout borderLayout = new BorderLayout();
	borderLayout.setHgap(50);
	borderLayout.setVgap(50);
	
	this.setLayout(borderLayout);
	this.setSize(850, 500);
	this.setAutoscrolls(true);		
	this.setBorder(null);
	this.setFocusable(true);
	this.setVisible(true);
	this.add(getOntoSplitPane(), BorderLayout.CENTER);
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:19,代碼來源:OntologyTab.java

示例3: JPanel4Visualisation

import java.awt.BorderLayout; //導入方法依賴的package包/類
/**
 * Instantiates a new j panel4 visualization.
 *
 * @param tabName the tab name
 */
public JPanel4Visualisation(Project project, String tabName) {
	super();
	this.currProject = project;
	this.tabName = tabName;
	
	BorderLayout borderLayout = new BorderLayout();
	borderLayout.setHgap(10);
	borderLayout.setVgap(10);
	this.setLayout(borderLayout);
	
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:17,代碼來源:JPanel4Visualisation.java

示例4: layoutSelectResourcePanel

import java.awt.BorderLayout; //導入方法依賴的package包/類
/**
 * @author  Marian Petras
 */
static void layoutSelectResourcePanel(final Container thePanel,
                                      final String instructionsText,
                                      final String selectionLabelText,
                                      final Component selectionComp,
                                      final JButton button1,
                                      final JButton button2) {
    JTextArea instructions = new JTextArea();
    JLabel lblSelection = new JLabel();

    instructions.setColumns(20);
    instructions.setEditable(false);
    instructions.setLineWrap(true);
    instructions.setText(instructionsText);
    instructions.setWrapStyleWord(true);
    instructions.setDisabledTextColor(new JLabel().getForeground());
    instructions.setEnabled(false);
    instructions.setOpaque(false);

    lblSelection.setLabelFor(selectionComp);
    Mnemonics.setLocalizedText(lblSelection, selectionLabelText);

    JScrollPane scrollPane = new JScrollPane(selectionComp);

    Container filesSelection = new JPanel();
    GroupLayout layout = new GroupLayout(filesSelection);
    filesSelection.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(LEADING)
        .addComponent(lblSelection)
        .addGroup(layout.createSequentialGroup()
            .addComponent(scrollPane, 0, DEFAULT_SIZE, Integer.MAX_VALUE)
            .addPreferredGap(RELATED)
            .addGroup(layout.createParallelGroup(LEADING)
                .addComponent(button1)
                .addComponent(button2)))
    );

    layout.linkSize(SwingConstants.HORIZONTAL, button1, button2);

    layout.setVerticalGroup(
        layout.createParallelGroup(LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(lblSelection)
            .addPreferredGap(RELATED)
            .addGroup(layout.createParallelGroup(LEADING)
                .addComponent(scrollPane, 0, DEFAULT_SIZE, Integer.MAX_VALUE)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(button1)
                    .addPreferredGap(RELATED)
                    .addComponent(button2))))
    );

    LayoutStyle layoutStyle = layout.getLayoutStyle();
    if (layoutStyle == null) {
        layoutStyle = LayoutStyle.getInstance();
    }

    BorderLayout mainLayout = new BorderLayout();
    thePanel.setLayout(mainLayout);
    thePanel.add(instructions, BorderLayout.PAGE_START);
    thePanel.add(filesSelection, BorderLayout.CENTER);
    mainLayout.setVgap(layoutStyle.getPreferredGap(instructions,
                                                   lblSelection,
                                                   UNRELATED,
                                                   SwingConstants.NORTH,
                                                   thePanel));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:71,代碼來源:Util.java

示例5: ChallengeGUI

import java.awt.BorderLayout; //導入方法依賴的package包/類
/**
 * Create the main GUI window.
 */
public ChallengeGUI()
{
	super("Challenge");
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	
	setJMenuBar(new Menus());
			
	model = new ChallengeModel();
	bracket = new BracketPane(model);
	bracketScroll = new JScrollPane(bracket);
	bracketScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
	bracketScroll.getViewport().setBackground(Color.WHITE);
	bracketScroll.getViewport().setLayout(new BetterViewportLayout());
	
	tree = new EntrantTree();
	tree.setDragEnabled(true);
	
	bonusSelect = new JComboBox<String>(new String[] { "Bonus", "Regular" });
	bonusSelect.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			tree.useBonusDialins(bonusSelect.getSelectedItem().equals("Bonus"));
		}
	});
	bonusSelect.setSelectedItem("Bonus");  // just to make sure everyone is on the same page
	
	SelectionBar selectBar = new SelectionBar();

	JScrollPane tpane = new JScrollPane(tree);
	tpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
	tpane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

	JPanel main = new JPanel(new MigLayout("fill", "[grow 0][fill]", "[grow 0][]"));
	
	main.add(new JLabel("Drag drives with"), "split 3");
	main.add(bonusSelect, "");
	main.add(new JLabel("dialins"), "");
	main.add(bracketScroll, "spany 2, grow, wrap");
	main.add(tpane, "growy, w 200!");

	BorderLayout layout = new BorderLayout();
	layout.setHgap(5);
	layout.setVgap(5);
	JPanel content = new JPanel(layout);
	content.add(selectBar, BorderLayout.NORTH);
	content.add(main, BorderLayout.CENTER);
	
	setContentPane(content);
	setSize(1024,768);
	setVisible(true);
	
    Database.openDefault();
}
 
開發者ID:drytoastman,項目名稱:scorekeeperfrontend,代碼行數:57,代碼來源:ChallengeGUI.java


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