本文整理汇总了Java中java.awt.GridLayout类的典型用法代码示例。如果您正苦于以下问题:Java GridLayout类的具体用法?Java GridLayout怎么用?Java GridLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridLayout类属于java.awt包,在下文中一共展示了GridLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JAERDataViewer
import java.awt.GridLayout; //导入依赖的package包/类
/** Creates new form JAERDataViewer */
public JAERDataViewer(String title) {
initComponents();
this.setTitle(title);
pnlGraph = new GraphPanel();
pnlGraph.setBackground(new java.awt.Color(255, 255, 255));
pnlGraph.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
pnlGraphContainer.setLayout(new GridLayout(0,1));
pnlGraph.setUpdateEvent(new GraphPanelUpdateEvent() {
public void update() {
updateAxeBoxes();
}
});
pnlGraphContainer.add(pnlGraph);
pnlGraphContainer.revalidate();
pnlGraphContainer.repaint();
pnlGraph.setResizeX(false);
pnlGraph.setResizeY(true);
updateAxeBoxes();
periodicUpdate(true);
tblData.setModel(tabledata);
}
示例2: FirstPassageTimeTest
import java.awt.GridLayout; //导入依赖的package包/类
public FirstPassageTimeTest(){
super(new GridLayout(1,2));
int dbscanMeter = 500;
loadRealWorldData(new DistanceWithUnit(dbscanMeter, SpatialDistanceUnit.Meter));
HashMap<Long, Double> values = null;
values = firstPassageTimeCalculationTest();
double[][] plotValues = new double [values.keySet().size()][2];
int index=0;
for(Entry<Long, Double> entry:values.entrySet()){
plotValues[index][0] = entry.getKey();
plotValues[index][1] = entry.getValue();
index++;
}
PlotCanvas canvas = LinePlot.plot("First passage time", plotValues, Line.Style.SOLID, Color.RED);
canvas.setTitle("First passage time (DBSCAN=" + dbscanMeter + "m)");
canvas.setAxisLabels("t (hour)", "Fpt (t)");
add(canvas);
}
示例3: FInfoDialog
import java.awt.GridLayout; //导入依赖的package包/类
/**
* Creates new form FStandAdvance
*/
public FInfoDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
infoDialog = this;
initComponents();
if (WelcomeParams.getInstance().btnFont != null) {
buttonBack.setFont(WelcomeParams.getInstance().btnFont);
buttonInRoot.setFont(WelcomeParams.getInstance().btnFont);
buttonPrint.setFont(WelcomeParams.getInstance().btnFont);
jButton2.setFont(WelcomeParams.getInstance().btnFont);
}
//На верхней панели пункта регистрации, там где заголовок и картинка в углу, можно вывести вэб-контент по URL. Оставьте пустым если не требуется
if (!WelcomeParams.getInstance().topURL.isEmpty()) {
panelUp.removeAll();
final BrowserFX bro = new BrowserFX();
final GridLayout gl = new GridLayout(1, 1);
panelUp.setLayout(gl);
panelUp.add(bro);
bro.load(Uses.prepareAbsolutPathForImg(WelcomeParams.getInstance().topURL));
}
}
示例4: BrowserFX
import java.awt.GridLayout; //导入依赖的package包/类
public BrowserFX() {
javafxPanel = new JFXPanel();
GridLayout gl = new GridLayout(1, 1);
setLayout(gl);
add(javafxPanel, BorderLayout.CENTER);
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
}
Platform.runLater(() -> {
bro = new Browser();
bro.getWebEngine().setJavaScriptEnabled(true);
Scene scene = new Scene(bro, 750, 500, Color.web("#666970"));
javafxPanel.setScene(scene);
ready = true;
});
}
示例5: initSave
import java.awt.GridLayout; //导入依赖的package包/类
void initSave() {
savePanel = new JPanel(new GridLayout(0,1));
savePanel.setBorder( BorderFactory.createTitledBorder("Save Options"));
ButtonGroup gp = new ButtonGroup();
saveToFile = new JToggleButton("Save ASCII table");
savePanel.add( saveToFile );
gp.add( saveToFile );
saveToClipboard = new JToggleButton("Copy to clipboard");
savePanel.add( saveToClipboard );
gp.add( saveToClipboard );
saveJPEG = new JToggleButton("Save JPEG image");
savePanel.add( saveJPEG );
gp.add( saveJPEG );
savePNG = new JToggleButton("Save PNG image");
savePanel.add( savePNG );
gp.add( savePNG );
print = new JToggleButton("Print");
savePanel.add( print );
gp.add( print );
}
示例6: getReplacemetPanel
import java.awt.GridLayout; //导入依赖的package包/类
private Component getReplacemetPanel() {
JPanel group = new JPanel(new GridLayout(0, 1));
group.setBorder(BorderFactory.createTitledBorder(ResourceLoader
.getString("ArrowReplacementType.name")));
group.add(safe = new JRadioButton("ArrowReplacementType.safe"));
group.add(children = new JRadioButton("ArrowReplacementType.branching"));
group.add(all = new JRadioButton("ArrowReplacementType.everywhere"));
safe.setSelected(true);
ButtonGroup g = new ButtonGroup();
g.add(children);
g.add(all);
g.add(safe);
setReplaceEnable(false);
return group;
}
示例7: FilesModifiedConfirmation
import java.awt.GridLayout; //导入依赖的package包/类
public FilesModifiedConfirmation(SaveCookie[] saveCookies) {
btnSaveAll = createSaveAllButton();
btnSave = createSaveButton();
Mnemonics.setLocalizedText(btnSaveAll, getInitialSaveAllButtonText());
Mnemonics.setLocalizedText(btnSave, getInitialSaveButtonText());
JScrollPane scrollPane
= new JScrollPane(list = createFilesList(saveCookies));
if (!listModel.isEmpty()) {
list.setSelectedIndex(0);
} else {
updateSaveButtonState();
}
JComponent panel = new JPanel(new GridLayout(1, 1));
panel.add(scrollPane);
panel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
mainComponent = panel;
}
示例8: 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");
}
示例9: VisualPanelCopyOptions
import java.awt.GridLayout; //导入依赖的package包/类
/**
* Create the panel.
*/
public VisualPanelCopyOptions() {
setLayout(new GridLayout(0, 1, 0, 0));
copyFont = new JCheckBox("Visual.copyFont");
copyFont.setSelected(true);
add(copyFont);
copyBackground = new JCheckBox("Visual.copyBackground");
copyBackground.setSelected(true);
add(copyBackground);
copyForeground = new JCheckBox("Visual.copyForeground");
copyForeground.setSelected(true);
add(copyForeground);
copySize = new JCheckBox("Visual.copySize");
copySize.setSelected(true);
add(copySize);
}
示例10: redoLayout
import java.awt.GridLayout; //导入依赖的package包/类
/**
* Removes and adds the single result blocks according to the current width.
*/
private void redoLayout() {
resultPanel.removeAll();
if (expanded) {
int curWidth = parent.getSize().width;
int relevantWidth = SingleResultOverview.MIN_WIDTH + 25;
int xCount = curWidth / relevantWidth;
int yCount = (int) Math.ceil((double) results.size() / xCount);
resultPanel.setLayout(new GridLayout(yCount, xCount));
for (SingleResultOverview overview : results) {
resultPanel.add(overview);
}
}
revalidate();
}
示例11: BhattiproluPad
import java.awt.GridLayout; //导入依赖的package包/类
public BhattiproluPad() {
mainFrame = new JFrame("Bhattiprolu Pad - Now, type in Telugu easily");
mainFrame.setSize(800, 800);
mainFrame.setLayout(new GridLayout(3, 1));
headLabel = new JLabel("Bhattiprolu Pad 0.1", JLabel.CENTER);
contentLabel = new JLabel("Empty", JLabel.CENTER);
mainPanel = new JPanel();
mainPanel.setLayout(new FlowLayout());
headLabel.setFont(englishFont);
contentLabel.setFont(teluguFont);
mainFrame.add(headLabel);
mainFrame.add(mainPanel);
mainFrame.add(contentLabel);
mainFrame.setVisible(true);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
示例12: initComponents
import java.awt.GridLayout; //导入依赖的package包/类
private void initComponents() {
Box vBox = Box.createVerticalBox();
Box hBox = Box.createHorizontalBox();
synView = new JTextPane();
synView.setContentType("text/html");
synView.setEditable(false);
synScroll = new JScrollPane(synView);
synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
vBox.add(Box.createVerticalStrut(30));
vBox.add(hBox);
vBox.add(Box.createVerticalStrut(30));
hBox.add(Box.createHorizontalStrut(20));
hBox.add(synScroll);
hBox.add(Box.createHorizontalStrut(20));
this.setLayout(new GridLayout(1, 1));
this.add(vBox);
}
示例13: initSave
import java.awt.GridLayout; //导入依赖的package包/类
void initSave() {
savePanel = new JPanel(new GridLayout(0,1));
savePanel.setBorder( BorderFactory.createTitledBorder("Save Options"));
ButtonGroup gp = new ButtonGroup();
saveToFile = new JToggleButton("Save ASCII table");
savePanel.add( saveToFile );
gp.add( saveToFile );
saveToClipboard = new JToggleButton("Copy to clipboard");
savePanel.add( saveToClipboard );
gp.add( saveToClipboard );
saveJPEG = new JToggleButton("Save JPEG image");
savePanel.add( saveJPEG );
gp.add( saveJPEG );
savePNG = new JToggleButton("Save PNG image");
savePanel.add( savePNG );
gp.add( savePNG );
saveToExcel = new JToggleButton("Save Excel table");
savePanel.add( saveToExcel );
gp.add( saveToExcel );
print = new JToggleButton("Print");
savePanel.add( print );
gp.add( print );
}
示例14: AbstractTreeEditor
import java.awt.GridLayout; //导入依赖的package包/类
public AbstractTreeEditor()
{
tree = createTree();
tree.addTreeSelectionListener(this);
tree.setPreferredSize(new Dimension(325, 0));
tree.setMinimumSize(new Dimension(325, 0));
// Ensure the root nodes start loading
tree.loadChildren(tree.getRootNode());
editArea = new JPanel(new GridLayout(1, 1));
AppletGuiUtils.removeBordersFromSplitPane(this);
setOrientation(JSplitPane.HORIZONTAL_SPLIT);
setContinuousLayout(true);
setResizeWeight(0.05);
add(tree, JSplitPane.LEFT);
add(editArea, JSplitPane.RIGHT);
noSelectionEditor = new BasicMessageEditor(
CurrentLocale.get("com.tle.admin.gui.common.tree.nodeeditor.nonodeselected"));
showTreeNodeEditor(noSelectionEditor);
}
示例15: initComponents
import java.awt.GridLayout; //导入依赖的package包/类
private void initComponents() {
Box vBox = Box.createVerticalBox();
Box hBox = Box.createHorizontalBox();
synView = new JTextPane();
synView.setContentType("text/html");
synView.setEditable(false);
synScroll = new JScrollPane(synView);
synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
vBox.add(Box.createVerticalStrut(30));
vBox.add(hBox);
vBox.add(Box.createVerticalStrut(30));
hBox.add(Box.createHorizontalStrut(20));
hBox.add(synScroll);
hBox.add(Box.createHorizontalStrut(20));
this.setLayout(new GridLayout(1, 1));
this.add(vBox);
synView
.setText("<html><body><center><font face=\"bold\" size=\"3\">Saturation Sectors will be here displayed once you solve the model.</font></center></body></html>");
}