List of usage examples for java.lang Boolean FALSE
Boolean FALSE
To view the source code for java.lang Boolean FALSE.
Click Source Link
From source file:Main.java
public static void main(String[] args) { System.out.println(Boolean.FALSE); }
From source file:TreeEdit.java
public static void main(String args[]) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Object array[] = { Boolean.TRUE, Boolean.FALSE, "Hello" }; // Hello will map to false JTree tree = new JTree(array); tree.setEditable(true);/*from w w w .j a va 2 s. c o m*/ tree.setRootVisible(true); JCheckBox checkBox = new JCheckBox(); TreeCellEditor editor = new DefaultCellEditor(checkBox); tree.setCellEditor(editor); JScrollPane scrollPane = new JScrollPane(tree); frame.add(scrollPane, BorderLayout.CENTER); frame.setSize(300, 150); frame.setVisible(true); }
From source file:Main.java
public static void main(final String args[]) { JFrame frame = new JFrame("Editable Tree"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Object array[] = { Boolean.TRUE, Boolean.FALSE, "Hello" }; JTree tree = new JTree(array); tree.setEditable(true);//w ww .j a v a 2 s . c o m tree.setRootVisible(true); JCheckBox checkBox = new JCheckBox(); TreeCellEditor editor = new DefaultCellEditor(checkBox); tree.setCellEditor(editor); JScrollPane scrollPane = new JScrollPane(tree); frame.add(scrollPane, BorderLayout.CENTER); frame.setSize(300, 150); frame.setVisible(true); }
From source file:MainClass.java
public static void main(String args[]) throws Exception { JFrame frame = new JFrame("Filled Slider"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JSlider js1 = new JSlider(); js1.putClientProperty("JSlider.isFilled", Boolean.TRUE); JSlider js2 = new JSlider(); js2.putClientProperty("JSlider.isFilled", Boolean.FALSE); frame.getContentPane().add(js1, BorderLayout.NORTH); frame.getContentPane().add(js2, BorderLayout.SOUTH); frame.setSize(300, 200);/*ww w . jav a2 s . com*/ frame.setVisible(true); }
From source file:TreeEdit.java
public static void main(String args[]) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Object array[] = { Boolean.TRUE, Boolean.FALSE, "Hello" }; JTree tree = new JTree(array); tree.setEditable(true);//from w w w. j a v a 2s. co m tree.setRootVisible(true); DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tree.getCellRenderer(); String elements[] = { "A", "B", "C", "D" }; JComboBox comboBox = new JComboBox(elements); comboBox.setEditable(true); TreeCellEditor comboEditor = new DefaultCellEditor(comboBox); TreeCellEditor editor = new DefaultTreeCellEditor(tree, renderer, comboEditor); tree.setCellEditor(editor); JScrollPane scrollPane = new JScrollPane(tree); frame.add(scrollPane, BorderLayout.CENTER); frame.setSize(300, 150); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { DefaultMutableTreeNode root = new DefaultMutableTreeNode(Boolean.TRUE); DefaultMutableTreeNode child1 = new DefaultMutableTreeNode(Boolean.FALSE); DefaultMutableTreeNode child2 = new DefaultMutableTreeNode(Boolean.FALSE); root.add(child1);// w w w . j a v a 2s . c o m root.add(child2); DefaultTreeModel model = new DefaultTreeModel(root); JTree tree = new JTree(model); tree.setCellRenderer(new TreeRenderer()); tree.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { TreePath pathForLocation = tree.getPathForLocation(e.getX(), e.getY()); Object lastPathComponent = pathForLocation.getLastPathComponent(); if (lastPathComponent instanceof DefaultMutableTreeNode) { Boolean oldObject = (Boolean) ((DefaultMutableTreeNode) lastPathComponent).getUserObject(); ((DefaultMutableTreeNode) lastPathComponent).setUserObject(!oldObject); model.nodeChanged((DefaultMutableTreeNode) lastPathComponent); } } }); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(tree, BorderLayout.CENTER); frame.setSize(800, 600); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) throws Exception { String filename = "yourXML.xml"; XMLInputFactory xmlif = null; xmlif = XMLInputFactory.newInstance(); xmlif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE); xmlif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); xmlif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); xmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE); System.out.println("FACTORY: " + xmlif); System.out.println("filename = " + filename); FileInputStream fis = new FileInputStream(filename); XMLStreamReader xmlr = xmlif.createFilteredReader(xmlif.createXMLStreamReader(fis), new MyFilter()); int eventType = xmlr.getEventType(); printEventType(eventType);//from ww w .ja v a 2 s. c o m while (xmlr.hasNext()) { eventType = xmlr.next(); printEventType(eventType); printName(xmlr, eventType); printText(xmlr); if (xmlr.isStartElement()) { printAttributes(xmlr); } printPIData(xmlr); } }
From source file:ColumnSample.java
public static void main(String args[]) { TableModel model = new AbstractTableModel() { Icon icon1 = new ImageIcon("TreeCollapsed.gif"); Icon icon2 = new ImageIcon("TreeExpanded.gif"); Object rowData[][] = { { "1", "ichi", Boolean.TRUE, new Date("01/01/2000"), icon1 }, { "2", "ni", Boolean.TRUE, new Date("04/15/1999"), icon2 }, { "3", "san", Boolean.FALSE, new Date("12/07/1941"), icon2 }, { "4", "shi", Boolean.TRUE, new Date("02/29/2000"), icon1 }, { "5", "go", Boolean.FALSE, new Date("05/23/1995"), icon1 }, }; String columnNames[] = { "English", "Japanese", "Boolean", "Date", "ImageIcon" }; public int getColumnCount() { return columnNames.length; }//from w w w . ja v a2 s. c o m public String getColumnName(int column) { return columnNames[column]; } public int getRowCount() { return rowData.length; } public Object getValueAt(int row, int column) { return rowData[row][column]; } public Class getColumnClass(int column) { return (getValueAt(0, column).getClass()); } }; JFrame frame = new JFrame("Column Renderer Table"); JTable table = new JTable(model); JScrollPane scrollPane = new JScrollPane(table); frame.getContentPane().add(scrollPane, BorderLayout.CENTER); frame.setSize(400, 150); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) throws Exception { String filename = "yourXML.xml"; XMLInputFactory xmlif = null; xmlif = XMLInputFactory.newInstance(); xmlif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE); xmlif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); xmlif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); xmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE); System.out.println("FACTORY: " + xmlif); System.out.println("filename = " + filename); FileInputStream fis = new FileInputStream(filename); XMLStreamReader xmlr = xmlif.createFilteredReader(xmlif.createXMLStreamReader(fis), new Main()); int eventType = xmlr.getEventType(); printEventType(eventType);// ww w .j av a 2 s . c o m while (xmlr.hasNext()) { eventType = xmlr.next(); printEventType(eventType); printName(xmlr, eventType); printText(xmlr); if (xmlr.isStartElement()) { printAttributes(xmlr); } printPIData(xmlr); } }
From source file:StaxCursorTest.java
public static void main(String[] args) throws Exception { String filename = "yourXML.xml"; XMLInputFactory xmlif = null; xmlif = XMLInputFactory.newInstance(); xmlif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE); xmlif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); xmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE); try {/*from ww w . j a v a2 s.co m*/ XMLStreamReader xmlr = xmlif.createXMLStreamReader(filename, new FileInputStream(filename)); int eventType = xmlr.getEventType(); printStartDocument(xmlr); while (xmlr.hasNext()) { eventType = xmlr.next(); printStartElement(xmlr); printEndElement(xmlr); printText(xmlr); printPIData(xmlr); printComment(xmlr); } } catch (XMLStreamException ex) { System.out.println(ex.getMessage()); if (ex.getNestedException() != null) { ex.getNestedException().printStackTrace(); } } }