List of usage examples for java.awt BorderLayout WEST
String WEST
To view the source code for java.awt BorderLayout WEST.
Click Source Link
From source file:bestdeal.gui.Statistique.java
/** * Creates new form Statistique/*from w ww . ja v a2 s . c om*/ */ @SuppressWarnings("empty-statement") public Statistique() { initComponents(); btn_retour.setIcon((Icon) new ImageIcon("C:\\Users\\Jedidi\\Desktop\\icone\\retour.png")); panel = new ImagePanel(new ImageIcon("C:\\Users\\Jedidi\\Desktop\\111.jpg").getImage()); Panel.add(panel); lbl_log.setIcon((Icon) new ImageIcon("C:\\Users\\Jedidi\\Desktop\\Logo_.png")); SimpleDateFormat sdf1 = new SimpleDateFormat("dd-MM-yyyy"); lbl_date1.setText(sdf1.format(new java.util.Date())); SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm:ss"); lbl_heure.setText(sdf2.format(new java.util.Date())); final DefaultPieDataset objDataset = new DefaultPieDataset(); VoucherDAO v2 = new VoucherDAO(); String[][] stat = v2.StatDeal(); objDataset.setValue(stat[0][0], Integer.parseInt(stat[9][0])); objDataset.setValue(stat[0][1], Integer.parseInt(stat[9][1])); objDataset.setValue(stat[0][2], Integer.parseInt(stat[9][2])); objDataset.setValue(stat[0][3], Integer.parseInt(stat[9][3])); objDataset.setValue(stat[0][4], Integer.parseInt(stat[9][4])); JFreeChart objChart = ChartFactory.createPieChart3D("Best 5 deals", objDataset, true, true, true); //String textTitle = "Best 5 deals"; TextTitle textTitle = objChart.getTitle(); textTitle.setFont(new Font("Arial", Font.BOLD, 15)); panel_deals.setLayout(new java.awt.BorderLayout()); panel_clients.setLayout(new java.awt.BorderLayout()); panel_vendeurs.setLayout(new java.awt.BorderLayout()); final ChartPanel CP = new ChartPanel(objChart); CP.setPreferredSize(new java.awt.Dimension(600, 500)); panel_deals.add(CP, BorderLayout.WEST); panel_deals.validate(); TabbedPane.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { if (TabbedPane.getSelectedIndex() == 0) { objDataset.clear(); VoucherDAO v2 = new VoucherDAO(); String[][] stat = v2.StatDeal(); objDataset.setValue(stat[0][0], Integer.parseInt(stat[9][0])); objDataset.setValue(stat[0][1], Integer.parseInt(stat[9][1])); objDataset.setValue(stat[0][2], Integer.parseInt(stat[9][2])); objDataset.setValue(stat[0][3], Integer.parseInt(stat[9][3])); objDataset.setValue(stat[0][4], Integer.parseInt(stat[9][4])); panel_deals.add(CP, BorderLayout.WEST); panel_deals.validate(); } else if (TabbedPane.getSelectedIndex() == 1) { objDataset.clear(); VoucherDAO v2 = new VoucherDAO(); String[][] stat = v2.StatVendeur(); objDataset.setValue(stat[1][0], Integer.parseInt(stat[7][0])); objDataset.setValue(stat[1][1], Integer.parseInt(stat[7][1])); objDataset.setValue(stat[1][2], Integer.parseInt(stat[7][2])); objDataset.setValue(stat[1][3], Integer.parseInt(stat[7][3])); objDataset.setValue(stat[1][4], Integer.parseInt(stat[7][4])); panel_vendeurs.add(CP, BorderLayout.WEST); panel_vendeurs.validate(); } else if (TabbedPane.getSelectedIndex() == 2) { objDataset.clear(); VoucherDAO v2 = new VoucherDAO(); String[][] stat = v2.StatClient(); objDataset.setValue(stat[1][0], Integer.parseInt(stat[4][0])); objDataset.setValue(stat[1][1], Integer.parseInt(stat[4][1])); objDataset.setValue(stat[1][2], Integer.parseInt(stat[4][2])); objDataset.setValue(stat[1][3], Integer.parseInt(stat[4][3])); objDataset.setValue(stat[1][4], Integer.parseInt(stat[4][4])); panel_clients.add(CP, BorderLayout.WEST); panel_clients.validate(); } else if (TabbedPane.getSelectedIndex() == 3) { } } }); }
From source file:org.kepler.gui.kar.KarManifestViewer.java
public void initialize(KARFile karFile) { if (isDebugging) { log.debug("initialize( " + karFile + " )"); }//from w ww .ja v a 2 s . c o m _karFile = karFile; JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new BorderLayout()); JPanel lsidPanel = new JPanel(); lsidPanel.setLayout(new BorderLayout()); JLabel lsidLabel = new JLabel("KAR LSID:"); lsidPanel.add(lsidLabel, BorderLayout.WEST); _lsidField = new JTextField(""); _lsidField.setEditable(false); lsidPanel.add(_lsidField, BorderLayout.CENTER); JPanel dfPanel = new JPanel(); dfPanel.setLayout(new BorderLayout()); _manifestField = new JTextArea(""); _manifestField.setEditable(false); _manifestScrollPane = new JScrollPane(_manifestField); _manifestScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); _manifestScrollPane .setBorder( BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Manifest"), BorderFactory.createEmptyBorder(5, 5, 5, 5)), _manifestScrollPane.getBorder())); dfPanel.add(_manifestScrollPane, BorderLayout.CENTER); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new BorderLayout()); String infStr = _karFile.getName(); JLabel objInfo = new JLabel(infStr); buttonPanel.add(objInfo, BorderLayout.CENTER); JButton refreshButton = new JButton("Refresh"); refreshButton.addActionListener(this); buttonPanel.add(refreshButton, BorderLayout.EAST); layoutPanel.add(lsidPanel, BorderLayout.NORTH); layoutPanel.add(dfPanel, BorderLayout.CENTER); layoutPanel.add(buttonPanel, BorderLayout.SOUTH); getContentPane().add(layoutPanel); refreshValues(); getContentPane().setBackground(Color.WHITE); }
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()); }/*from w w w. j a v a 2 s . 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)); }
From source file:livecanvas.mesheditor.MeshEditor.java
public MeshEditor() { super("Mesh Editor", new ImageIcon(clazz.getResource("res/mesh_editor.png")), new BorderLayout()); setPreferredSize(new Dimension(1024, 600)); setBackground(Color.darkGray); tools = createTools();//from ww w . ja v a2s. c om add(tools, BorderLayout.WEST); selectedColor = Color.black; JPanel east = new JPanel(new BorderLayout()); east.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); Layer rootLayer = new Layer("ROOT"); rootLayer.addSubLayer(new Layer("Layer1")); layersView = new LayersView(rootLayer); chain(layersView); layersView.addListener(this); east.add(layersView, BorderLayout.NORTH); propertiesPanel = new JPanel(new BorderLayout()); east.add(propertiesPanel); viewpointsView = new ViewpointsView(layersView.getSelectedLayer()); viewpointsView.addListener(this); east.add(viewpointsView, BorderLayout.SOUTH); add(east, BorderLayout.EAST); JPanel center = new JPanel(new BorderLayout()); center.setBackground(Color.lightGray); canvas = new CanvasMesh(800, 600); canvas.setCurrLayer(getRootLayer()); pointerHandler = new AffineTransformPointerHandler(canvas); canvas.setPointerHandler(pointerHandler); canvasContainer = new CanvasContainer(canvas); rootLayer.setCanvas(canvas); center.add(canvasContainer); renderImageSettings = new RenderImageSettings(); settings = new MeshEditorSettings(canvas.getSettings(), layersView.getSettings(), renderImageSettings); add(center); layersView.layersList.setSelectedIndex(1); setSelectedToolType(TOOLS_BRUSH); }
From source file:gdt.jgui.console.JItemPanel.java
/** * The constructor.//www . j a va2s. co m * @param console the main console. * @param locator$ the item's locator. */ public JItemPanel(JMainConsole console, String locator$) { this.console = console; this.locator$ = locator$; setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setAlignmentX(Component.LEFT_ALIGNMENT); try { this.console = console; this.locator$ = locator$; Properties locator = Locator.toProperties(locator$); if (Locator.LOCATOR_TRUE.equals(locator.getProperty(Locator.LOCATOR_CHECKABLE))) { checkbox = new JCheckBox(); add(checkbox); if (Locator.LOCATOR_TRUE.equals(locator.getProperty(Locator.LOCATOR_CHECKED))) if (checkbox != null) checkbox.setSelected(true); } title$ = locator.getProperty(Locator.LOCATOR_TITLE); if (title$ != null) { title = new JLabel(title$, JLabel.LEFT); title.setText(title$); title.setOpaque(true); title.addMouseListener(new MousePopupListener()); title.setAlignmentX(Component.LEFT_ALIGNMENT); add(title, BorderLayout.WEST); icon$ = locator.getProperty(Locator.LOCATOR_ICON); if (icon$ != null) { byte[] ba = Base64.decodeBase64(icon$); ImageIcon icon = new ImageIcon(ba); Image image = icon.getImage().getScaledInstance(24, 24, 0); icon.setImage(image); title.setIcon(icon); } } else LOGGER.info("title is null"); } catch (Exception e) { LOGGER.severe(e.toString()); } }
From source file:net.femtoparsec.jwhois.gui.JWhoIsQueryGUI.java
public JWhoIsQueryGUI(JWhoIsGUIModel<?> model) { Validate.notNull(model, "model"); this.model = model; this.model.addSourceResultListener(this); this.resourceBundle = Utf8ResourceBundle.getBundle("JWhoIsQueryGUI"); this.setLayout(new BorderLayout()); this.queryField = new JTextField(); queryField.setActionCommand(QUERY_FIELD_ACTION_NAME); queryField.addActionListener(this); queryField.addKeyListener(this); queryField.setPreferredSize(new Dimension(300, queryField.getHeight())); this.queryButton = new JButton(resourceBundle.getString("query.button.label")); queryButton.setActionCommand(QUERY_BUTTON_ACTION_NAME); queryButton.addActionListener(this); final String labelLabel = resourceBundle.getString("query.label.label"); this.add(new JLabel(labelLabel), BorderLayout.WEST); this.add(this.queryField, BorderLayout.CENTER); this.add(this.queryButton, BorderLayout.EAST); this.queryField.setText(this.model.getQuery()); this.updateButtonState(); }
From source file:ChooseDropActionDemo.java
public ChooseDropActionDemo() { super("ChooseDropActionDemo"); for (int i = 15; i >= 0; i--) { from.add(0, "Source item " + i); }/* w w w.java2 s . c o m*/ for (int i = 2; i >= 0; i--) { copy.add(0, "Target item " + i); move.add(0, "Target item " + i); } JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); dragFrom = new JList(from); dragFrom.setTransferHandler(new FromTransferHandler()); dragFrom.setPrototypeCellValue("List Item WWWWWW"); dragFrom.setDragEnabled(true); dragFrom.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JLabel label = new JLabel("Drag from here:"); label.setAlignmentX(0f); p.add(label); JScrollPane sp = new JScrollPane(dragFrom); sp.setAlignmentX(0f); p.add(sp); add(p, BorderLayout.WEST); JList moveTo = new JList(move); moveTo.setTransferHandler(new ToTransferHandler(TransferHandler.COPY)); moveTo.setDropMode(DropMode.INSERT); JList copyTo = new JList(copy); copyTo.setTransferHandler(new ToTransferHandler(TransferHandler.MOVE)); copyTo.setDropMode(DropMode.INSERT); p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); label = new JLabel("Drop to COPY to here:"); ; label.setAlignmentX(0f); p.add(label); sp = new JScrollPane(moveTo); sp.setAlignmentX(0f); p.add(sp); label = new JLabel("Drop to MOVE to here:"); label.setAlignmentX(0f); p.add(label); sp = new JScrollPane(copyTo); sp.setAlignmentX(0f); p.add(sp); p.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); add(p, BorderLayout.CENTER); ((JPanel) getContentPane()).setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); getContentPane().setPreferredSize(new Dimension(320, 315)); }
From source file:com.googlecode.commons.swing.component.datetime.MiniDateCalendar.java
private void init() { final DateFormatSymbols dfs = new DateFormatSymbols(locale); CollectionUtils.addAll(this.weekdays, dfs.getShortWeekdays()); for (int i = 0; i < 7; i++) { orderedWeekdays.add(((i + weekDayStart - 1) % 7) + 1); }/*from w w w . java 2 s .c o m*/ setLayout(new BorderLayout()); SizeUtils.setAllWidths(this, 150); SizeUtils.setAllHeights(this, 180); panNorth = new JPanel(new BorderLayout()); add(panNorth, BorderLayout.NORTH); btnPrev = new JButton(); SizeUtils.setAllWidths(btnPrev, 18); SizeUtils.setAllHeights(btnPrev, 18); btnPrev.setIcon(DefaultIcons.resultset_previous()); btnPrev.setMargin(new Insets(0, 0, 0, 0)); btnPrev.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { onClickPrev(); } }); panNorth.add(btnPrev, BorderLayout.WEST); lblMonth = new JLabel(); SizeUtils.setMinHeight(lblMonth, 0); SizeUtils.setPreferredHeight(lblMonth, 0); lblMonth.setHorizontalAlignment(SwingConstants.CENTER); panNorth.add(lblMonth, BorderLayout.CENTER); btnNext = new JButton(); btnNext.setIcon(DefaultIcons.resultset_next()); SizeUtils.setAllWidths(btnNext, 18); SizeUtils.setAllHeights(btnNext, 18); btnNext.setMargin(new Insets(0, 0, 0, 0)); btnNext.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { onClickNext(); } }); panNorth.add(btnNext, BorderLayout.EAST); panCenter = new JPanel(); panCenter.setLayout(new GridLayout(7, 7)); add(panCenter, BorderLayout.CENTER); for (int col = 0; col < 7; col++) { JLabel lblDay = new JLabel(weekdays.get(orderedWeekdays.get(col))); lblDay.setHorizontalAlignment(SwingConstants.CENTER); panCenter.add(lblDay); } ButtonGroup grp = new ButtonGroup(); for (int row = 0; row < 6; row++) { for (int col = 0; col < 7; col++) { final int day = orderedWeekdays.get(col); final DayButton btn = createDayButton(day, weekdays.get(day)); btn.setMargin(new Insets(0, 0, 0, 0)); btn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { onClickDay(btn.value); } }); days.add(btn); grp.add(btn); panCenter.add(btn); } } refresh(); }
From source file:net.sourceforge.doddle_owl.ui.GeneralOntologySelectionPanel.java
public GeneralOntologySelectionPanel(NameSpaceTable nsTable) { nameSpaceTable = nsTable;//from ww w .j a v a 2s.com edrCheckBox = new JCheckBox(Translator.getTerm("GenericEDRCheckBox"), false); edrCheckBox.addActionListener(this); edrtCheckBox = new JCheckBox(Translator.getTerm("TechnicalEDRCheckBox"), false); edrtCheckBox.addActionListener(this); wnCheckBox = new JCheckBox(Translator.getTerm("WordNetCheckBox"), false); wnCheckBox.addActionListener(this); wnVersionSelectionPanel = new JPanel(); wn30RadioButton = new JRadioButton("3.0"); wn30RadioButton.addChangeListener(this); wn31RadioButton = new JRadioButton("3.1"); wn31RadioButton.setSelected(true); wn31RadioButton.addChangeListener(this); ButtonGroup group = new ButtonGroup(); group.add(wn30RadioButton); group.add(wn31RadioButton); wnVersionSelectionPanel.add(wnCheckBox); wnVersionSelectionPanel.add(wn30RadioButton); wnVersionSelectionPanel.add(wn31RadioButton); JPanel borderPanel = new JPanel(); borderPanel.setLayout(new BorderLayout()); borderPanel.add(wnVersionSelectionPanel, BorderLayout.WEST); jpnWnCheckBox = new JCheckBox(Translator.getTerm("JpnWordNetCheckBox"), false); jpnWnCheckBox.addActionListener(this); jwoCheckBox = new JCheckBox(Translator.getTerm("JWOCheckBox"), false); jwoCheckBox.addActionListener(this); JPanel checkPanel = new JPanel(); checkPanel.add(borderPanel); checkPanel.add(jpnWnCheckBox); checkPanel.add(jwoCheckBox); checkPanel.add(edrCheckBox); checkPanel.add(edrtCheckBox); setLayout(new BorderLayout()); add(checkPanel, BorderLayout.WEST); generalOntologyDirLabel = new JLabel(Utils.TEMP_DIR); removeGeneralOntologyDirButton = new JButton(Translator.getTerm("RemoveGeneralOntologyDirectoryButton")); removeGeneralOntologyDirButton.addActionListener(this); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new BorderLayout()); buttonPanel.add(generalOntologyDirLabel, BorderLayout.CENTER); buttonPanel.add(removeGeneralOntologyDirButton, BorderLayout.WEST); add(buttonPanel, BorderLayout.SOUTH); }
From source file:org.kepler.gui.lsid.LSIDViewer.java
public void initialize(NamedObj no) { if (isDebugging) { log.debug("initialize( " + no.getName() + " " + no.getClass().getName() + " )"); }/*from w w w .j a va 2 s. co m*/ _no = no; JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new BorderLayout()); JPanel lsidPanel = new JPanel(); lsidPanel.setLayout(new BorderLayout()); JLabel lsidLabel = new JLabel("LSID:"); lsidPanel.add(lsidLabel, BorderLayout.WEST); _lsidField = new JTextField(""); _lsidField.setEditable(false); lsidPanel.add(_lsidField, BorderLayout.CENTER); JPanel dfPanel = new JPanel(); dfPanel.setLayout(new BorderLayout()); _derivedFromField = new JTextArea(""); _derivedFromField.setEditable(false); _derivedFromScrollPane = new JScrollPane(_derivedFromField); _derivedFromScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); _derivedFromScrollPane .setBorder( BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Derived From"), BorderFactory.createEmptyBorder(5, 5, 5, 5)), _derivedFromScrollPane.getBorder())); dfPanel.add(_derivedFromScrollPane, BorderLayout.CENTER); JPanel bottomPanel = new JPanel(); bottomPanel.setLayout(new BorderLayout()); String infStr = "Name: " + _no.getName(); JLabel objInfo = new JLabel(infStr); if (isEditingEnabled()) { bottomPanel.add(objInfo, BorderLayout.NORTH); } else { bottomPanel.add(objInfo, BorderLayout.CENTER); } JPanel buttonPanel = new JPanel(); if (isEditingEnabled()) { JButton newObjButton = new JButton("New Object ID"); newObjButton.addActionListener(this); buttonPanel.add(newObjButton); JButton revisionButton = new JButton("Roll Revision"); revisionButton.addActionListener(this); buttonPanel.add(revisionButton); } JButton refreshButton = new JButton("Refresh"); refreshButton.addActionListener(this); buttonPanel.add(refreshButton); bottomPanel.add(buttonPanel, BorderLayout.EAST); layoutPanel.add(lsidPanel, BorderLayout.NORTH); layoutPanel.add(dfPanel, BorderLayout.CENTER); layoutPanel.add(bottomPanel, BorderLayout.SOUTH); getContentPane().add(layoutPanel); refreshValues(); }