本文整理汇总了Java中java.awt.FlowLayout.LEADING属性的典型用法代码示例。如果您正苦于以下问题:Java FlowLayout.LEADING属性的具体用法?Java FlowLayout.LEADING怎么用?Java FlowLayout.LEADING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.FlowLayout
的用法示例。
在下文中一共展示了FlowLayout.LEADING属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AlignmentPropertyEditor
public AlignmentPropertyEditor() {
super(
new int[] {
FlowLayout.CENTER,
FlowLayout.LEFT,
FlowLayout.RIGHT,
FlowLayout.LEADING,
FlowLayout.TRAILING
},
new String[] {
"java.awt.FlowLayout.CENTER", // NOI18N
"java.awt.FlowLayout.LEFT", // NOI18N
"java.awt.FlowLayout.RIGHT", // NOI18N
"java.awt.FlowLayout.LEADING", // NOI18N
"java.awt.FlowLayout.TRAILING" // NOI18N
},
new String[] {
"VALUE_AlignmentCenter", // NOI18N
"VALUE_AlignmentLeft", // NOI18N
"VALUE_AlignmentRight", // NOI18N
"VALUE_AlignmentLeading", // NOI18N
"VALUE_AlignmentTrailing" // NOI18N
}
);
}
示例2: initComponents
private void initComponents() {
setLayout(new BorderLayout());
previewPanel = new JPanel(new FlowLayout(0, 0, FlowLayout.LEADING));
previewPanel.setBorder(BorderFactory.createEmptyBorder(4, 7, 2, 7));
label = new JLabel();
label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2, 7, 7, 7),
new ThinBevelBorder(BevelBorder.LOWERED)));
label.setBorder(BorderFactory.createCompoundBorder(label.getBorder(), BorderFactory.createEmptyBorder(4, 3, 4, 3)));
label.setFont(label.getFont().deriveFont(Font.BOLD));
JPanel p = new JPanel(new BorderLayout());
p.setBorder(BorderFactory.createRaisedBevelBorder());
p.add(previewPanel, BorderLayout.NORTH);
p.add(label, BorderLayout.CENTER);
add(p, BorderLayout.CENTER);
}
示例3: redraw
public void redraw() {
// We redraw only if data has changed - Sebastiano Spicuglia
if (!redrawNeeded)
return;
this.removeAll();
if (data.hasResults() && data.areResultsOK()
&& data.getResults().getSaturationSectors().size() > 0) {
if (data.getClasses() == 2) {
this.removeAll();
this.setLayout(new BorderLayout());
graph = new PerformanceIndices2DGraph(data);
this.add(new JabaCanvas(graph), BorderLayout.CENTER);
this.add(new JLabel(JabaConstants.DESCRIPITION_GRAPH_PERFORMANCE_INDEX),
BorderLayout.PAGE_END);
JPanel flowPanel = new JPanel(
new FlowLayout(FlowLayout.LEADING));
flowPanel.add(new JLabel(JabaConstants.SELECT_WHICH_INDEX));
whichIndexComboBox = new JComboBox(whichIndexArray);
whichIndexComboBox.addActionListener(this);
flowPanel.add(whichIndexComboBox);
//this.add(flowPanel, BorderLayout.PAGE_START);
repaint();
} else if (data.getClasses() == 3) {
this.removeAll();
// Not supported
repaint();
}
} else {
JEditorPane synView = new JTextPane();
synView.setContentType("text/html");
synView.setEditable(false);
JScrollPane synScroll = new JScrollPane(synView);
synScroll
.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
synScroll
.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
synView.setText("<html><body><center><font face=\"bold\" size=\"3\">Utilization will be here displayed once you solve the model.</font></center></body></html>");
this.add(synScroll);
repaint();
}
redrawNeeded = false;
}
示例4: LoadingSavegameDialog
/**
* Creates a dialog to set the options for loading a saved game.
*
* @param freeColClient The {@code FreeColClient} for the game.
* @param frame The owner frame.
*/
public LoadingSavegameDialog(FreeColClient freeColClient, JFrame frame) {
super(freeColClient, frame);
JPanel panel = new JPanel();
panel.setBorder(Utility.blankBorder(10, 10, 10, 10));
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
panel.setOpaque(false);
JLabel header = Utility.localizedHeaderLabel(
Messages.nameKey("loadingSavegameDialog"), JLabel.CENTER,
FontLibrary.FontSize.MEDIUM);
header.setBorder(Utility.blankBorder(20, 0, 0, 0));
JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEADING));
p1.add(Utility.localizedLabel("loadingSavegameDialog.serverName"));
serverNameField = new JTextField();
JPanel p2 = new JPanel(new FlowLayout(FlowLayout.LEADING));
p2.add(Utility.localizedLabel("loadingSavegameDialog.port"));
portField = new JSpinner(new SpinnerNumberModel(FreeCol.getServerPort(),
1, 65536, 1));
ButtonGroup bg = new ButtonGroup();
String str = Messages.message("loadingSavegameDialog.singlePlayer");
singlePlayer = new JRadioButton(str);
bg.add(singlePlayer);
str = Messages.message("loadingSavegameDialog.privateMultiplayer");
privateMultiplayer = new JRadioButton(str);
bg.add(privateMultiplayer);
str = Messages.message("loadingSavegameDialog.publicMultiplayer");
publicMultiplayer = new JRadioButton(str);
bg.add(publicMultiplayer);
panel.add(header);
panel.add(p1);
panel.add(serverNameField);
panel.add(p2);
panel.add(portField);
panel.add(singlePlayer);
panel.add(privateMultiplayer);
panel.add(publicMultiplayer);
panel.setSize(panel.getPreferredSize());
initializeConfirmDialog(frame, true, panel, null, "ok", "cancel");
}
示例5: getPanel
private JPanel getPanel(String key) {
JPanel result = new JPanel(new FlowLayout(FlowLayout.LEADING));
result.setOpaque(false);
result.setBorder(Utility.localizedBorder(key, Color.GRAY));
return result;
}