List of usage examples for javax.swing WindowConstants DISPOSE_ON_CLOSE
int DISPOSE_ON_CLOSE
To view the source code for javax.swing WindowConstants DISPOSE_ON_CLOSE.
Click Source Link
From source file:gtu._work.etc.GoogleContactUI.java
private void initGUI() { try {/*from www .j av a2 s . c o m*/ BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("jPanel1", null, jPanel1, null); { jScrollPane1 = new JScrollPane(); jPanel1.add(jScrollPane1, BorderLayout.CENTER); { DefaultTableModel model = JTableUtil.createModel(false, googleColumns); model.addRow(new Object[googleColumns.length]); googleTable = new JTable(); jScrollPane1.setViewportView(googleTable); googleTable.setModel(model); googleTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { JTableUtil.newInstance(googleTable).defaultToolTipText(evt); googleTableMouseClicked(evt); } }); JTableUtil.defaultSetting(googleTable); JTableUtil.newInstance(googleTable).showColumnByHeaderValue(defaultShow_googleColumns); } } } { jPanel2 = new JPanel(); BorderLayout jPanel2Layout = new BorderLayout(); jPanel2.setLayout(jPanel2Layout); jTabbedPane1.addTab("jPanel2", null, jPanel2, null); } } pack(); this.setSize(642, 405); } catch (Exception e) { e.printStackTrace(); } }
From source file:gtu._work.ui.LoadJspFetchJavascriptUI.java
private void initGUI() { try {/*from w w w. j av a 2 s . c o m*/ BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); jTabbedPane1.setPreferredSize(new java.awt.Dimension(436, 153)); { jPanel1 = new JPanel(); jTabbedPane1.addTab("jPanel1", null, jPanel1, null); jPanel1.setPreferredSize(new java.awt.Dimension(431, 125)); { jLabel1 = new JLabel(); jPanel1.add(jLabel1); jLabel1.setText("\u6a94\u6848\u8def\u5f91"); } { filePathText = new JTextField(); JCommonUtil.jTextFieldSetFilePathMouseEvent(filePathText, true); jPanel1.add(filePathText); filePathText.setPreferredSize(new java.awt.Dimension(354, 24)); } { jLabel2 = new JLabel(); jPanel1.add(jLabel2); jLabel2.setText("\u7db2\u9801\u526f\u6a94\u540d"); jLabel2.setPreferredSize(new java.awt.Dimension(81, 17)); } { subNameText = new JTextField(); jPanel1.add(subNameText); subNameText.setPreferredSize(new java.awt.Dimension(282, 24)); } { jLabel3 = new JLabel(); jPanel1.add(jLabel3); jLabel3.setText("\u8981\u6293\u7684TagPattern"); jLabel3.setPreferredSize(new java.awt.Dimension(115, 17)); } { tagPatternText = new JTextField(); jPanel1.add(tagPatternText); tagPatternText.setPreferredSize(new java.awt.Dimension(259, 24)); } { executeBtn = new JButton(); jPanel1.add(executeBtn); executeBtn.setText(""); executeBtn.setPreferredSize(new java.awt.Dimension(180, 45)); executeBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { executeBtnActionPerformed(evt); } }); } } } pack(); this.setSize(452, 218); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:gtu._work.etc.HotnoteMakerUI.java
private void initGUI() { try {//from www . j a v a2s.co m ToolTipManager.sharedInstance().setInitialDelay(0); BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("hott notes - checklist", null, jPanel1, null); { jScrollPane1 = new JScrollPane(); jPanel1.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(612, 348)); { checkListArea = new JTextArea(); jScrollPane1.setViewportView(checkListArea); checkListArea.addMouseListener(new MouseAdapter() { String randomColor() { StringBuilder sb = new StringBuilder().append("#"); for (int ii = 0; ii < 6; ii++) { sb.append(RandomUtil.randomChar('a', 'b', 'c', 'd', 'f', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9')); } return sb.toString(); } void saveXml(Document document, File file) { OutputFormat format = OutputFormat.createPrettyPrint(); format.setEncoding("utf-16"); XMLWriter writer = null; try { writer = new XMLWriter(new FileWriter(file), format); writer.write(document); } catch (IOException e) { JCommonUtil.handleException(e); } finally { if (writer != null) { try { writer.close(); } catch (IOException e) { JCommonUtil.handleException(e); } } } } public void mouseClicked(MouseEvent evt) { if (!JMouseEventUtil.buttonLeftClick(2, evt)) { return; } if (StringUtils.isEmpty(checkListArea.getText())) { JCommonUtil ._jOptionPane_showMessageDialog_error("checklist area is empty!"); return; } File file = JCommonUtil._jFileChooser_selectFileOnly_saveFile(); if (file == null) { JCommonUtil._jOptionPane_showMessageDialog_error("file is not correct!"); return; } //XXX StringTokenizer tok = new StringTokenizer(checkListArea.getText(), "\t\n\r\f"); List<String> list = new ArrayList<String>(); String tmp = null; for (; tok.hasMoreElements();) { tmp = ((String) tok.nextElement()).trim(); System.out.println(tmp); list.add(tmp); } //XXX Document document = DocumentHelper.createDocument(); Element rootHot = document.addElement("hottnote"); rootHot.addAttribute("creationtime", new Timestamp(System.currentTimeMillis()).toString()); rootHot.addAttribute("lastmodified", new Timestamp(System.currentTimeMillis()).toString()); rootHot.addAttribute("type", "checklist"); //appearence Element appearenceE = rootHot.addElement("appearence"); appearenceE.addAttribute("alpha", "204"); Element fontE = appearenceE.addElement("font"); fontE.addAttribute("face", "Default"); fontE.addAttribute("size", "0"); Element styleE = appearenceE.addElement("style"); styleE.addElement("bg2color").addAttribute("color", randomColor()); styleE.addElement("bgcolor").addAttribute("color", randomColor()); styleE.addElement("textcolor").addAttribute("color", randomColor()); styleE.addElement("titlecolor").addAttribute("color", randomColor()); //behavior rootHot.addElement("behavior"); //content Element contentE = rootHot.addElement("content"); Element checklistE = contentE.addElement("checklist"); for (String val : list) { checklistE.addElement("item").addCDATA(val); } //desktop Element desktopE = rootHot.addElement("desktop"); desktopE.addElement("position").addAttribute("x", RandomUtil.numberStr(3)) .addAttribute("y", RandomUtil.numberStr(3)); desktopE.addElement("size").addAttribute("height", "200").addAttribute("width", "200"); //title Element titleE = rootHot.addElement("title"); titleE.addCDATA(StringUtils.defaultIfEmpty(checkListTitle.getText(), DateFormatUtils.format(System.currentTimeMillis(), "dd/MM/yyyy"))); if (!file.getName().toLowerCase().endsWith(".hottnote")) { file = new File(file.getParentFile(), file.getName() + ".hottnote"); } saveXml(document, file); JCommonUtil._jOptionPane_showMessageDialog_info("completed!\n" + file); } }); } } { checkListTitle = new JTextField(); checkListTitle.setToolTipText("title"); jPanel1.add(checkListTitle, BorderLayout.NORTH); } } } pack(); this.setSize(633, 415); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:org.mahasen.client.gui.Property.java
/** This method is called from within the constructor to * initialize the form.// w w w.j a v a 2 s .com * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); addCustomPropertyNameTextField = new javax.swing.JTextField(); addCustomPropertValueTextField = new javax.swing.JTextField(); addAnotherProepertyButton = new javax.swing.JButton(); addCustomProeprtyOkButton = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); addedPropertTablePanel = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); addedPropertyTable = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Custom Property"); jLabel1.setText("Name"); jLabel2.setText("Value"); addCustomPropertyNameTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addCustomPropertyNameTextFieldActionPerformed(evt); } }); addAnotherProepertyButton.setText("Add Another"); addAnotherProepertyButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addAnotherProepertyButtonActionPerformed(evt); } }); addCustomProeprtyOkButton.setText("Ok"); addCustomProeprtyOkButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addCustomProeprtyOkButtonActionPerformed(evt); } }); jButton3.setText("Cancel"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); addedPropertyTable.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "Property Name", "Property Value" }) { Class[] types = new Class[] { java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean[] { false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane1.setViewportView(addedPropertyTable); addedPropertyTable.getColumnModel().getColumn(0).setResizable(false); addedPropertyTable.getColumnModel().getColumn(1).setResizable(false); javax.swing.GroupLayout addedPropertTablePanelLayout = new javax.swing.GroupLayout(addedPropertTablePanel); addedPropertTablePanel.setLayout(addedPropertTablePanelLayout); addedPropertTablePanelLayout.setHorizontalGroup( addedPropertTablePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(addedPropertTablePanelLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 363, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(20, Short.MAX_VALUE))); addedPropertTablePanelLayout.setVerticalGroup( addedPropertTablePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(addedPropertTablePanelLayout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(95, 95, 95).addComponent(addAnotherProepertyButton) .addGap(26, 26, 26) .addComponent(addCustomProeprtyOkButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(54, Short.MAX_VALUE)) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addGap(44, 44, 44) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1).addComponent(addCustomPropertyNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(addCustomPropertValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup().addGap(8, 8, 8) .addComponent(jLabel2))) .addGap(29, 29, 29)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(35, Short.MAX_VALUE) .addComponent(addedPropertTablePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(33, 33, 33) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(jLabel2)) .addGap(28, 28, 28) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(addCustomPropertyNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(addCustomPropertValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(addedPropertTablePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(addAnotherProepertyButton).addComponent(addCustomProeprtyOkButton) .addComponent(jButton3)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width - 448) / 2, (screenSize.height - 309) / 2, 448, 309); }
From source file:gtu._work.ui.JSFMakerUI_attrDialog.java
private void initGUI() { try {/* w ww . j a va 2 s . c o m*/ final SwingActionUtil actionUtil = SwingActionUtil.newInstance(this); BorderLayout thisLayout = new BorderLayout(); getContentPane().setLayout(thisLayout); this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("attribute", null, jPanel1, null); { jScrollPane1 = new JScrollPane(); jPanel1.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(379, 233)); { DefaultTableModel model = JTableUtil.createModel(true, "enable", "attribute", "value"); attrTable = new JTable(); //XXX defnine attribute model.addRow(transfromAttribute(new Attribute("size", null, "", new String[] { "", "3", "5", "10", "15", "20" }))); model.addRow(transfromAttribute( new Attribute("readonly", null, "", new String[] { "", "false", "true" }))); model.addRow(transfromAttribute( new Attribute("styleClass", null, "", new String[] { "", "readonly-input" }))); //XXX defnine attribute jScrollPane1.setViewportView(attrTable); attrTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); attrTable.setAutoscrolls(true); attrTable.setAutoCreateRowSorter(false); attrTable.setUpdateSelectionOnSort(false); attrTable.setAutoCreateColumnsFromModel(true); attrTable.setColumnSelectionAllowed(true); attrTable.setModel(model); attrTable.getTableHeader().setAutoscrolls(true); attrTable.getTableHeader().setDebugGraphicsOptions(DebugGraphics.BUFFERED_OPTION); attrTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { actionUtil.invokeAction(evt); } }); attrTable.addKeyListener(JTableUtil.newInstance(attrTable).defaultKeyAdapter()); } } { confirmOk = new JButton(); jPanel1.add(confirmOk, BorderLayout.SOUTH); confirmOk.setText("OK"); confirmOk.setPreferredSize(new java.awt.Dimension(379, 32)); confirmOk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { actionUtil.invokeAction(evt); } }); } } actionUtil.addAction(confirmOk, ActionEvent.class, new Action() { public void action(EventObject evt) throws Exception { dispose(); setVisible(false); } }); actionUtil.addAction(attrTable, MouseEvent.class, new Action() { public void action(EventObject evt) throws Exception { if (!JMouseEventUtil.buttonLeftClick(2, evt)) { return; } int colPos = JTableUtil.newInstance(attrTable).getSelectedColumn(); int rowPos = JTableUtil.newInstance(attrTable).getSelectedRow(); Function func = Function.valueOf(colPos); if (func == null) { System.err.println("ERROR!!!!!"); return; } Attribute realAttr = (Attribute) JTableUtil.newInstance(attrTable).getModel() .getValueAt(rowPos, Function.VALUE.col); switch (func) { case ENABLE: boolean bool = (Boolean) JTableUtil.newInstance(attrTable).getModel().getValueAt(rowPos, Function.ENABLE.col); JTableUtil.newInstance(attrTable).getModel().setValueAt(!bool, rowPos, Function.ENABLE.col); break; case ATTRIBUTE: break; case VALUE: String value = (String) JOptionPaneUtil.newInstance().showInputDialog_drowdown("choice", "", realAttr.dropdown, realAttr.defaultVal); realAttr.value = value; JTableUtil.newInstance(attrTable).getModel().setValueAt(StringUtils.isNotEmpty(value), rowPos, Function.ENABLE.col); break; } } }); } setSize(400, 300); } catch (Exception e) { e.printStackTrace(); } }
From source file:gtu._work.ui.DbFieldJavaFieldUI.java
private void initGUI() { try {//w w w . ja v a2s . c o m BorderLayout thisLayout = new BorderLayout(); getContentPane().setLayout(thisLayout); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("", null, jPanel1, null); { jScrollPane3 = new JScrollPane(); jPanel1.add(jScrollPane3, BorderLayout.CENTER); jScrollPane3.setPreferredSize(new java.awt.Dimension(379, 209)); { replaceBeforeArea = new JTextArea(); jScrollPane3.setViewportView(replaceBeforeArea); } } { jPanel3 = new JPanel(); jPanel1.add(jPanel3, BorderLayout.NORTH); jPanel3.setPreferredSize(new java.awt.Dimension(379, 28)); { dbToJavaRadio = new JRadioButton(); jPanel3.add(dbToJavaRadio); dbToJavaRadio.setText("DB->Java"); } { javaToDbRadio = new JRadioButton(); jPanel3.add(javaToDbRadio); javaToDbRadio.setText("Java->DB"); } } } { jPanel2 = new JPanel(); BorderLayout jPanel2Layout = new BorderLayout(); jPanel2.setLayout(jPanel2Layout); jTabbedPane1.addTab("??", null, jPanel2, null); { jScrollPane1 = new JScrollPane(); jPanel2.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(379, 233)); { jScrollPane2 = new JScrollPane(); jScrollPane1.setViewportView(jScrollPane2); jScrollPane2.setPreferredSize(new java.awt.Dimension(376, 230)); { replaceAfterArea = new JTextArea(); jScrollPane2.setViewportView(replaceAfterArea); } } } } { jPanel4 = new JPanel(); BorderLayout jPanel4Layout = new BorderLayout(); jPanel4.setLayout(jPanel4Layout); jTabbedPane1.addTab("setter", null, jPanel4, null); { jScrollPane4 = new JScrollPane(); jPanel4.add(jScrollPane4, BorderLayout.CENTER); jScrollPane4.setPreferredSize(new java.awt.Dimension(379, 233)); { getSetRelArea = new JTextArea(); jScrollPane4.setViewportView(getSetRelArea); } } } } buttonGroup1 = new ButtonGroup(); buttonGroup1.add(dbToJavaRadio); dbToJavaRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { System.out.println("dbToJavaRadio.actionPerformed, event=" + evt); //TODO add your code for dbToJavaRadio.actionPerformed execute(DbJava.DB_TO_JAVA); } }); buttonGroup1.add(javaToDbRadio); javaToDbRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { System.out.println("javaToDbRadio.actionPerformed, event=" + evt); //TODO add your code for javaToDbRadio.actionPerformed execute(DbJava.JAVA_TO_DB); } }); pack(); setSize(400, 300); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:org.pf.midea.MainUI.java
private void showConstellationWindow(ConstellationPoint[] _map, String _name) { JFrame constellation = new JFrame(" ?? " + _name); constellation.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); XYSeriesCollection dots = new XYSeriesCollection(); XYSeries series = new XYSeries(_name); JFreeChart chart = ChartFactory.createScatterPlot("", "I", "Q", dots, PlotOrientation.VERTICAL, false, false, false);//w w w. jav a 2 s .co m XYPlot xyPlot = chart.getXYPlot(); CustomXYToolTipGenerator tooltipsGenerator = new CustomXYToolTipGenerator(); ArrayList<String> tooltips = new ArrayList<>(); for (ConstellationPoint ccp : _map) { double I = ccp.getI(); double Q = ccp.getQ(); series.add(I, Q); tooltips.add(ccp.getCode().getStringSequence()); } tooltipsGenerator.addToolTipSeries(tooltips); xyPlot.getRenderer().setBaseToolTipGenerator(tooltipsGenerator); double maxX = StatisticsTools.round(Math.abs(series.getMaxX()), 3); double maxY = StatisticsTools.round(Math.abs(series.getMaxY()), 3); double minX = StatisticsTools.round(Math.abs(series.getMinX()), 3); double minY = StatisticsTools.round(Math.abs(series.getMinY()), 3); if (maxX != 0 || minX != 0) { double X = Math.max(minX, maxX); xyPlot.getDomainAxis().setRange(-1.1 * X, 1.1 * X); } else xyPlot.getDomainAxis().setRange(-1, 1); if (maxY != 0 || minY != 0) { double Y = Math.max(minY, maxY); xyPlot.getRangeAxis().setRange(-1.1 * Y, 1.1 * Y); } else xyPlot.getRangeAxis().setRange(-1, 1); dots.addSeries(series); xyPlot.setBackgroundPaint(Color.WHITE); xyPlot.setDomainGridlinePaint(Color.GRAY); xyPlot.setRangeGridlinePaint(Color.GRAY); xyPlot.getRenderer().setSeriesPaint(0, Color.BLACK); xyPlot.setDomainZeroBaselineVisible(true); xyPlot.setRangeZeroBaselineVisible(true); ChartPanel chartPanel = new ChartPanel(chart); JPanel nestedPanel = new JPanel(); nestedPanel.add(chartPanel, new CellConstraints()); constellation.add(nestedPanel); constellation.pack(); constellation.setLocationRelativeTo(null); constellation.setResizable(false); constellation.setVisible(true); }
From source file:de.huberlin.cuneiform.compiler.debug.DebugDispatcher.java
public DebugDispatcher(File buildDir, File logFile, String dagid) { super(buildDir, logFile, dagid); JSplitPane splitPane;//from www .j av a2 s. c o m frame = new JFrame("Cuneiform Debug Interface"); frame.setSize(700, 500); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.setLayout(new BorderLayout()); addMenu(); invocOverview = new InvocOverview(this); contentOverview = new ContentOverview(frame); splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, invocOverview, contentOverview); // splitPane.setResizeWeight( .5 ); splitPane.setDividerLocation(350); frame.add(splitPane, BorderLayout.CENTER); }
From source file:gtu._work.ui.RenameUI.java
private void initGUI() { try {/* w w w. j ava2s. c o m*/ BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); jTabbedPane1.addTab("jPanel1", null, jPanel1, null); { jLabel1 = new JLabel(); jPanel1.add(jLabel1); jLabel1.setText("\u9078\u64c7\u76ee\u9304"); } { srcDirText = new JTextField(); JCommonUtil.jTextFieldSetFilePathMouseEvent(srcDirText, true); jPanel1.add(srcDirText); srcDirText.setPreferredSize(new java.awt.Dimension(470, 22)); } { jLabel2 = new JLabel(); jPanel1.add(jLabel2); jLabel2.setText("\u6a94\u540dRegex"); jLabel2.setPreferredSize(new java.awt.Dimension(68, 15)); } { findFileRegexText = new JTextField(); jPanel1.add(findFileRegexText); findFileRegexText.setPreferredSize(new java.awt.Dimension(446, 22)); } { jLabel3 = new JLabel(); jPanel1.add(jLabel3); jLabel3.setText("\u4fee\u6539\u5f8c\u6a94\u540d"); jLabel3.setPreferredSize(new java.awt.Dimension(68, 15)); } { renameRegexText = new JTextField(); jPanel1.add(renameRegexText); renameRegexText.setPreferredSize(new java.awt.Dimension(446, 22)); } { scanBtn = new JButton(); jPanel1.add(scanBtn); scanBtn.setText("\u6383\u63cf\u76ee\u9304"); scanBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { scanBtnActionPerformed(); } }); } { usePatternNewNameBtn = new JButton(); jPanel1.add(usePatternNewNameBtn); usePatternNewNameBtn.setText("\u5957\u7528\u6a94\u540d"); usePatternNewNameBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { usePatternNewNameBtnActionPerformed(); } }); } { executeBtn = new JButton(); jPanel1.add(executeBtn); executeBtn.setText("\u4ee5\u8868\u683c\u8a2d\u5b9a\u66f4\u6b63"); executeBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { executeBtnActionPerformed(); } }); } } { jPanel2 = new JPanel(); BorderLayout jPanel2Layout = new BorderLayout(); jPanel2.setLayout(jPanel2Layout); jTabbedPane1.addTab("jPanel2", null, jPanel2, null); { jScrollPane1 = new JScrollPane(); jPanel2.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(552, 338)); { renameTable = new JTable(); jScrollPane1.setViewportView(renameTable); JTableUtil.defaultSetting(renameTable); renameTable.setModel(createNewModel()); } } } } pack(); this.setSize(565, 392); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:dbmods.InsertTemplateName.java
private void initGUI() { try {//from w ww . j a va 2s. c om setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(null); getContentPane().setName("Insert Into parse_template"); addTemplateName(); addCheckboxes(); addTechnology(); addUserName(); addServer(); addLogWindow(); addInsertButton(); pack(); this.setSize(410, 424); jTemplateNameText.requestFocus(); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }