List of usage examples for java.awt BorderLayout EAST
String EAST
To view the source code for java.awt BorderLayout EAST.
Click Source Link
From source file:QandE.SwingApp2.java
void createGUI(JFrame f) { startButton = new JButton("Start"); stopButton = new JButton("Stop"); stopButton.setEnabled(false);// ww w. j av a 2 s. c o m label = new JLabel("Press Start.", JLabel.CENTER); Container c = f.getContentPane(); //Use the content pane's default BorderLayout layout manager. c.add(startButton, BorderLayout.WEST); c.add(stopButton, BorderLayout.EAST); c.add(label, BorderLayout.SOUTH); }
From source file:com.sec.ose.osi.ui.frm.main.manage.FileBrowser.java
public FileBrowser() { txtLocation = new JLabel(); setLocationSize(txtSize);//from ww w . j ava 2s . c om txtLocation.setOpaque(true); txtLocation.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); txtLocation.setBackground(Color.white); btnBrowse = new JButton("Browse"); btnBrowse.addActionListener(this); setButtonSize(btnSize); Border boder = BorderFactory.createEmptyBorder(2, 2, 2, 2); this.setLayout(new BorderLayout(2, 2)); this.add(BorderLayout.CENTER, txtLocation); this.add(BorderLayout.EAST, btnBrowse); this.setBackground(Color.white); this.setBorder(boder); }
From source file:net.nosleep.superanalyzer.analysis.views.EncodingKindView.java
public JPanel getPanel(HomePanel homePanel) { JPanel panel = new JPanel(new BorderLayout()); JPanel headerPanel = homePanel.createHeaderPanel(_comboBox, _analysis.tagsAreIncomplete()); panel.add(headerPanel, BorderLayout.NORTH); panel.add(_chartPanel, BorderLayout.CENTER); panel.add(homePanel.createRightButtonBarPanel(_rotator), BorderLayout.EAST); return panel; }
From source file:net.sf.mzmine.modules.visualization.ida.IDAVisualizerWindow.java
public IDAVisualizerWindow(RawDataFile dataFile, Range<Double> rtRange, Range<Double> mzRange, IntensityType intensityType, NormalizationType normalizationType, Double minPeakInt, ParameterSet parameters) {/*from w ww . ja v a2s. c om*/ super("IDA visualizer: [" + dataFile.getName() + "]"); setDefaultCloseOperation(DISPOSE_ON_CLOSE); setBackground(Color.white); this.dataFile = dataFile; this.tooltipMode = true; dataset = new IDADataSet(dataFile, rtRange, mzRange, intensityType, normalizationType, minPeakInt, this); toolBar = new IDAToolBar(this); add(toolBar, BorderLayout.EAST); IDAPlot = new IDAPlot(this, dataFile, this, dataset, rtRange, mzRange); add(IDAPlot, BorderLayout.CENTER); bottomPanel = new IDABottomPanel(this, dataFile, parameters); add(bottomPanel, BorderLayout.SOUTH); updateTitle(); // After we have constructed everything, load the peak lists into the // bottom panel bottomPanel.rebuildPeakListSelector(); MZmineCore.getDesktop().addPeakListTreeListener(bottomPanel); // Add the Windows menu JMenuBar menuBar = new JMenuBar(); menuBar.add(new WindowsMenu()); setJMenuBar(menuBar); pack(); // get the window settings parameter ParameterSet paramSet = MZmineCore.getConfiguration().getModuleParameters(IDAVisualizerModule.class); WindowSettingsParameter settings = paramSet.getParameter(IDAParameters.windowSettings); // update the window and listen for changes settings.applySettingsToWindow(this); this.addComponentListener(settings); }
From source file:net.sf.mzmine.modules.visualization.msms.MsMsVisualizerWindow.java
public MsMsVisualizerWindow(RawDataFile dataFile, Range<Double> rtRange, Range<Double> mzRange, IntensityType intensityType, NormalizationType normalizationType, Double minPeakInt, ParameterSet parameters) {//from w w w.j a va 2s . co m super("MS/MS visualizer: [" + dataFile.getName() + "]"); setDefaultCloseOperation(DISPOSE_ON_CLOSE); setBackground(Color.white); this.dataFile = dataFile; this.tooltipMode = true; dataset = new MsMsDataSet(dataFile, rtRange, mzRange, intensityType, normalizationType, minPeakInt, this); toolBar = new MsMsToolBar(this); add(toolBar, BorderLayout.EAST); IDAPlot = new MsMsPlot(this, dataFile, this, dataset, rtRange, mzRange); add(IDAPlot, BorderLayout.CENTER); bottomPanel = new MsMsBottomPanel(this, dataFile, parameters); add(bottomPanel, BorderLayout.SOUTH); updateTitle(); // After we have constructed everything, load the peak lists into the // bottom panel bottomPanel.rebuildPeakListSelector(); MZmineCore.getDesktop().addPeakListTreeListener(bottomPanel); // Add the Windows menu JMenuBar menuBar = new JMenuBar(); menuBar.add(new WindowsMenu()); setJMenuBar(menuBar); pack(); // get the window settings parameter ParameterSet paramSet = MZmineCore.getConfiguration().getModuleParameters(MsMsVisualizerModule.class); WindowSettingsParameter settings = paramSet.getParameter(MsMsParameters.windowSettings); // update the window and listen for changes settings.applySettingsToWindow(this); this.addComponentListener(settings); }
From source file:kenh.xscript.elements.Debug.java
private void initial(Container c) { c.setLayout(new BorderLayout()); // Add variable list DefaultListModel<String> model = new DefaultListModel(); if (this.getEnvironment() != null) { java.util.Set<String> keys = this.getEnvironment().getVariables().keySet(); for (String key : keys) { model.addElement(key);/*from w w w . j ava 2 s.co m*/ } } else { for (int i = 1; i < 10; i++) { model.addElement("Variable " + i); } model.addElement("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); } JList list = new JList(model); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane listPane = new JScrollPane(); listPane.setViewportView(list); listPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); c.add(listPane, BorderLayout.EAST); list.setPreferredSize(new Dimension(150, list.getPreferredSize().height)); // JTextField quote = new JTextField(); quote.requestFocus(); //JButton button = new JButton(">>"); JPanel quotePanel = new JPanel(); quotePanel.setLayout(new BorderLayout()); quotePanel.add(quote, BorderLayout.CENTER); //quotePanel.add(button, BorderLayout.EAST); JTextArea result = new JTextArea(); result.setEditable(false); JScrollPane resultPane = new JScrollPane(); resultPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); resultPane.setViewportView(result); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(quotePanel, BorderLayout.NORTH); panel.add(resultPane, BorderLayout.CENTER); c.add(panel, BorderLayout.CENTER); list.addListSelectionListener(this); //button.addActionListener(this); quote.addKeyListener(this); this.result = result; }
From source file:View.ReadView.java
public ReadView(ReadController controller, Email obj) throws IOException { this.frame = new JFrame(); this.topPane = new JPanel(); this.topLeftPane = new JPanel(); this.topRightPane = new JPanel(); this.topBottomPane = new JPanel(); this.container = frame.getContentPane(); this.controller = controller; this.bottomPane = new JPanel(); frame.setTitle("Ler Email"); container.setLayout(new BorderLayout(20, 20)); JButton btnSave = new JButton("Salvar no Banco"); btnSave.addActionListener((ActionEvent e) -> { try {//from w ww . j a v a 2s . c o m if (controller.save()) { JOptionPane.showMessageDialog(null, "Mensagem salva com sucesso"); } else { JOptionPane.showMessageDialog(null, "Erro ao salvar mensagem"); } } catch (ClassNotFoundException | SQLException | ParseException ex) { Logger.getLogger(ReadView.class.getName()).log(Level.SEVERE, null, ex); } }); JLabel labelAddress = new JLabel(); labelAddress.setText("Email: " + obj.getAddress()); JLabel labelDate = new JLabel(); labelDate.setText("Data: " + obj.getDate()); JLabel labelSubject = new JLabel(); labelSubject.setText("Assunto: " + obj.getSubject()); JTextArea message = new JTextArea(); message.append("Mensagem aqui..." + obj.getMessage()); messagePane = new JScrollPane(message); topPane.setLayout(new BorderLayout(20, 20)); topPane.add(BorderLayout.WEST, topLeftPane); topPane.add(BorderLayout.EAST, topRightPane); topPane.add(BorderLayout.SOUTH, topBottomPane); topLeftPane.setLayout(new FlowLayout(FlowLayout.LEFT)); topRightPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); topBottomPane.setLayout(new FlowLayout(FlowLayout.LEFT)); topLeftPane.add(labelAddress); topRightPane.add(labelDate); topBottomPane.add(labelSubject); bottomPane.add(btnSave); container.add(BorderLayout.NORTH, topPane); container.add(BorderLayout.CENTER, messagePane); container.add(BorderLayout.SOUTH, bottomPane); frame.pack(); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setSize(600, 600); Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); frame.setLocation(dim.width / 2 - frame.getSize().width / 2, dim.height / 2 - frame.getSize().height / 2); frame.setVisible(true); }
From source file:endrov.frameTime.FrameTimeWindow.java
/** * Make a new window at some specific location *//*from www . j a v a 2 s . co m*/ public FrameTimeWindow(Rectangle bounds) { bAdd.addActionListener(this); bApply.addActionListener(this); bRefresh.addActionListener(this); objectCombo.addActionListener(this); XYDataset xyDataset = new XYSeriesCollection(frametimeSeries); JFreeChart chart = ChartFactory.createXYLineChart("", "Time", "Frame", xyDataset, PlotOrientation.HORIZONTAL, false/*legend*/, false/*tooltips*/, false/*urls*/); ChartPanel graphpanel = new ChartPanel(chart); //Put GUI together JPanel datapanel = new JPanel(new BorderLayout()); JPanel dataparto = new JPanel(new BorderLayout()); dataparto.add(datapart, BorderLayout.NORTH); JScrollPane datapartscroll = new JScrollPane(dataparto, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); JPanel buttonpanel = new JPanel(new GridLayout(2, 2)); buttonpanel.add(bAdd); buttonpanel.add(bApply); buttonpanel.add(bRefresh); datapanel.add(buttonpanel, BorderLayout.SOUTH); datapanel.add(datapartscroll, BorderLayout.CENTER); setLayout(new BorderLayout()); add(datapanel, BorderLayout.EAST); JPanel leftPanel = new JPanel(new BorderLayout()); leftPanel.add(graphpanel, BorderLayout.CENTER); leftPanel.add(objectCombo, BorderLayout.SOUTH); add(leftPanel, BorderLayout.CENTER); loadData(); //Window overall things setTitleEvWindow("Frame/Time"); packEvWindow(); setVisibleEvWindow(true); setBoundsEvWindow(bounds); }
From source file:net.sf.mzmine.modules.visualization.tic.TICVisualizerWindow.java
/** * Constructor for total ion chromatogram visualizer *//*from w ww. ja v a 2 s . c o m*/ public TICVisualizerWindow(RawDataFile dataFiles[], PlotType plotType, int msLevel, Range rtRange, Range mzRange, Feature[] peaks, Map<Feature, String> peakLabels) { super(""); assert mzRange != null; assert rtRange != null; this.desktop = MZmineCore.getDesktop(); this.plotType = plotType; this.msLevel = msLevel; this.ticDataSets = new Hashtable<RawDataFile, TICDataSet>(); this.rtRange = rtRange; this.mzRange = mzRange; // setDefaultCloseOperation(DISPOSE_ON_CLOSE); setBackground(Color.white); ticPlot = new TICPlot(this); add(ticPlot, BorderLayout.CENTER); // toolBar = new TICToolBar(this); toolBar = new TICToolBar(ticPlot); add(toolBar, BorderLayout.EAST); // add all peaks if (peaks != null) { for (Feature peak : peaks) { if (peakLabels != null && peakLabels.containsKey(peak)) { final String label = peakLabels.get(peak); ticPlot.addLabelledPeakDataset(new PeakDataSet(peak, label), label); } else { ticPlot.addPeakDataset(new PeakDataSet(peak)); } } } // add all data files for (RawDataFile dataFile : dataFiles) { addRawDataFile(dataFile); } pack(); }
From source file:AliasBean.java
public AliasBean() { aliVector = new Vector(); aliJList = new JList(); // XXX MUST FIX THIS // aliJList.setSelectionMode(JList.SINGLE_SELECTION); aliJList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { int i = aliJList.getSelectedIndex(); if (i < 0) return; Alias al = (Alias) aliVector.get(i); nameTF.setText(al.getName()); addrTF.setText(al.getAddress()); }/* w w w.j a v a 2s.c o m*/ }); setLayout(new BorderLayout()); add(BorderLayout.WEST, new JScrollPane(aliJList)); JPanel rightPanel = new JPanel(); add(BorderLayout.EAST, rightPanel); rightPanel.setLayout(new GridLayout(0, 1)); JPanel buttons = new JPanel(); rightPanel.add(buttons); buttons.setLayout(new GridLayout(0, 1, 15, 15)); JButton b; buttons.add(b = new JButton("Set")); b.setToolTipText("Add or Change an alias"); b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { int i = aliJList.getSelectedIndex(); if (i < 0) { // XXX error dialog?? return; } setAlias(i, nameTF.getText(), addrTF.getText()); } }); buttons.add(b = new JButton("Delete")); b.setToolTipText("Delete the selected alias"); b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { int i = aliJList.getSelectedIndex(); if (i < 0) { return; } deleteAlias(i); } }); buttons.add(b = new JButton("Apply")); b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { System.err.println("NOT WRITTEN YET"); } }); JPanel fields = new JPanel(); rightPanel.add(fields); fields.setLayout(new GridLayout(2, 2)); fields.add(new JLabel("Name")); fields.add(nameTF = new JTextField(10)); fields.add(new JLabel("Address")); fields.add(addrTF = new JTextField(20)); }