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


Java GridLayout.setVgap方法代碼示例

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


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

示例1: createCapabilitiesPanel

import java.awt.GridLayout; //導入方法依賴的package包/類
public static JPanel createCapabilitiesPanel(Operator operator) {
	CapabilityProvider capabilityProvider = (CapabilityProvider) operator;
	int length = OperatorCapability.values().length;
	GridLayout layout = new GridLayout(length / 2, 2);
	layout.setHgap(GAP);
	layout.setVgap(GAP);
	JPanel capabilitiesPanel = new JPanel(layout);
	for (OperatorCapability capability : OperatorCapability.values()) {
		JLabel capabilityLabel = new JLabel(capability.getDescription());
		try {
			if (capabilityProvider.supportsCapability(capability)) {
				capabilityLabel.setIcon(SwingTools.createIcon("16/ok.png"));
			} else {
				capabilityLabel.setIcon(SwingTools.createIcon("16/error.png"));
			}
		} catch (Exception e) {
			break;
		}
		capabilitiesPanel.add(capabilityLabel);
	}
	return capabilitiesPanel;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:23,代碼來源:OperatorInfoScreen.java

示例2: InputPanel

import java.awt.GridLayout; //導入方法依賴的package包/類
public InputPanel(int size){
    grid = new JTextField[size][GRID_W];
    
    this.setBackground(Color.DARK_GRAY);
    
    GridLayout l = new GridLayout(size+1, GRID_W);
    l.setHgap(5);
    l.setVgap(5);
    this.setLayout(l);
    
    for(JLabel lbl : HEADLINES){
        lbl.setForeground(Color.LIGHT_GRAY);
        lbl.setHorizontalAlignment(JLabel.CENTER);
        this.add(lbl);
    }
    
    for(int i = 0; i < grid.length; i++){
        JLabel jlbl = new JLabel("10.1.1." + (i+1));
        jlbl.setForeground(Color.WHITE);
        this.add(jlbl);
        for(int j = 0; j < grid[i].length; j++)
            this.add(grid[i][j] = new JTextField());
    }
}
 
開發者ID:sachsenschnitzel,項目名稱:DBan-Config-Generator,代碼行數:25,代碼來源:InputPanel.java

示例3: initialize

import java.awt.GridLayout; //導入方法依賴的package包/類
/**
 * This method initializes this
 *
 * @return void
 */
private void initialize() {
    double[][] size = {{5, TableLayout.FILL, 5},
            {5, TableLayout.FILL, 5}};
    this.setLayout(new TableLayout(size));
    final GridLayout gridLayout3 = new GridLayout();
    JPanel child = new JPanel(gridLayout3);
    this.setSize(351, 105);
    gridLayout3.setRows(3);
    gridLayout3.setColumns(2);
    gridLayout3.setHgap(5);
    gridLayout3.setVgap(5);
    child.add(getJRadioButton(), null);
    child.add(getJRadioButton1(), null);
    child.add(getJRadioButton2(), null);
    child.add(getJRadioButton3(), null);
    child.add(getJRadioButton4(), null);
    child.add(getJTextField(), null);
    this.add(child, "1,1");
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:25,代碼來源:StatusPanel.java

示例4: PopupPane

import java.awt.GridLayout; //導入方法依賴的package包/類
public PopupPane() {
    listComponents = new HashSet<ListComponent>();
    view = new JPanel();
    GridLayout grid = new GridLayout(0, 1);
    grid.setHgap(0);
    grid.setVgap(0);
    view.setLayout(grid);
    view.setBorder(BorderFactory.createEmptyBorder());
    setName("progresspopup"); //NOI18N
    setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    setViewportView(view);
    setFocusable(true);
    setRequestFocusEnabled(true);

    Action down = new MoveDownAction();
    getActionMap().put("Move-Down", down);
    getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "Move-Down");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "Move-Down");
    
    Action up = new MoveUpAction();
    getActionMap().put("Move-Up", up);
    getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "Move-Up");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "Move-Up");
    Action cancel = new CancelAction();
    getActionMap().put("Cancel-Task", cancel);
    getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "Cancel-Task");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "Cancel-Task");
    
    Action select = new SelectAction();
    getActionMap().put("select-task", select);
    getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "select-task");
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "select-task");
    
    
    setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:37,代碼來源:PopupPane.java

示例5: showPSPAttrs

import java.awt.GridLayout; //導入方法依賴的package包/類
/**
 * Displays PSP attribute information, including total time, total defects injected, and
 * total defects removed. This information is automatically updated as the user completes
 * phases/tasks and is thus not editable by the user.
 */
public void showPSPAttrs() {
    setSize(getWidth(), getHeight() + 300);
	
	GridLayout gridLayout = new GridLayout(0, 2);
	gridLayout.setHgap(10);
	gridLayout.setVgap(10);
	
	pspPanel.setLayout(gridLayout);
	pspPanel.setBorder(new EtchedBorder());
	pspPanel.setBackground(Color.WHITE);
	
	// add combo box
	// pspPanel.add(phaseLabel);
	// pspPanel.add(currentPhase);
	
	// configure labels and text fields
	timeLabel.setText("Total Time (min)");
	defectsInjectedLabel.setText("Total Defects Injected");
	defectsRemovedLabel.setText("Total Defects Removed");
	totalLocCountLabel.setText(Local.getString("Total LOC"));
	// programSizeLabel.setText("Total LOC");
	defectLocRatioLabel.setText(Local.getString("Inj. Defects / LOC"));
	totalTime.setEnabled(false);
	totalDefectsInjected.setEnabled(false);
	totalDefectsRemoved.setEnabled(false);
	totalLocCountField.setEnabled(false);
	defectLocRatioField.setEnabled(false);
	// programSize.setEnabled(false);
	estimatedTimeLabel.setText("Estimated Time (min)");
	estimatedSizeLabel.setText("Estimated LOC");
	
	// add labels
	pspPanel.add(estimatedTimeLabel);
	pspPanel.add(estimatedTime);
	pspPanel.add(estimatedSizeLabel);
	pspPanel.add(estimatedSize);
    pspPanel.add(timeLabel);
    pspPanel.add(totalTime);
    pspPanel.add(defectsInjectedLabel);
    pspPanel.add(totalDefectsInjected);
    pspPanel.add(defectsRemovedLabel);
    pspPanel.add(totalDefectsRemoved);
    pspPanel.add(totalLocCountLabel);
    pspPanel.add(totalLocCountField);
    //pspPanel.add(programSizeLabel);
    //pspPanel.add(programSize);
    pspPanel.add(defectLocRatioLabel);
    pspPanel.add(defectLocRatioField);
    
    // add panel
    gbc = new GridBagConstraints();
    gbc.gridx = 0; gbc.gridy = 2;
    gbc.insets = new Insets(5, 10, 5, 10);
    gbc.anchor = GridBagConstraints.SOUTH;
    getContentPane().remove(bottomPanel); // remove bottom panel
    getContentPane().add(pspPanel, gbc);
    addBottomPanel(3); // re-add bottom panel
}
 
開發者ID:ser316asu,項目名稱:Reinickendorf_SER316,代碼行數:64,代碼來源:ProjectDialog.java


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