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:MyStreamFilter.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 MyStreamFilter()); int eventType = xmlr.getEventType(); printEventType(eventType);//w ww . ja va 2s . c om while (xmlr.hasNext()) { eventType = xmlr.next(); printEventType(eventType); printName(xmlr, eventType); printText(xmlr); if (xmlr.isStartElement()) { printAttributes(xmlr); } printPIData(xmlr); } }
From source file:Main.java
public static void main(String args[]) { JFrame frame = new JFrame("Simple Attributes"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); StyledDocument document = new DefaultStyledDocument(); SimpleAttributeSet attributes = new SimpleAttributeSet(); attributes.addAttribute(StyleConstants.CharacterConstants.Bold, Boolean.FALSE); attributes.addAttribute(StyleConstants.CharacterConstants.Italic, Boolean.FALSE); attributes.addAttribute(StyleConstants.CharacterConstants.Foreground, Color.LIGHT_GRAY); try {// w w w . jav a2 s.c o m document.insertString(document.getLength(), " Bold, Italic and light gray color", attributes); } catch (BadLocationException badLocationException) { System.err.println("Bad insert"); } JTextPane textPane = new JTextPane(document); textPane.setEditable(false); JScrollPane scrollPane = new JScrollPane(textPane); frame.add(scrollPane, BorderLayout.CENTER); frame.setSize(300, 150); frame.setVisible(true); }
From source file:SimpleAttributeBoldItalicColor.java
public static void main(String args[]) { JFrame frame = new JFrame("Simple Attributes"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); StyledDocument document = new DefaultStyledDocument(); SimpleAttributeSet attributes = new SimpleAttributeSet(); attributes = new SimpleAttributeSet(); attributes.addAttribute(StyleConstants.CharacterConstants.Bold, Boolean.FALSE); attributes.addAttribute(StyleConstants.CharacterConstants.Italic, Boolean.FALSE); attributes.addAttribute(StyleConstants.CharacterConstants.Foreground, Color.LIGHT_GRAY); try {//from w w w . ja v a2 s . com document.insertString(document.getLength(), " Bold, Italic and light gray color", attributes); } catch (BadLocationException badLocationException) { System.err.println("Bad insert"); } JTextPane textPane = new JTextPane(document); textPane.setEditable(false); JScrollPane scrollPane = new JScrollPane(textPane); frame.add(scrollPane, BorderLayout.CENTER); frame.setSize(300, 150); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { // Using constructors Boolean b1True = new Boolean(true); Boolean b2True = new Boolean("true"); Boolean b3True = new Boolean("tRuE"); Boolean b4False = new Boolean("false"); Boolean b5False = new Boolean("how is this"); // false // Using the factory methods Boolean b6True = Boolean.valueOf(true); Boolean b7True = Boolean.valueOf("true"); Boolean b8True = Boolean.valueOf("tRuE"); Boolean b9False = Boolean.valueOf("false"); Boolean b10False = Boolean.valueOf("how is this"); // false // Getting a boolean value from a Boolean object boolean bbTrue = b8True.booleanValue(); boolean bTrue = Boolean.parseBoolean("true"); boolean bFalse = Boolean.parseBoolean("This string evaluates to false"); Boolean bcTrue = Boolean.TRUE; Boolean bcFalse = Boolean.FALSE; System.out.println("bcTrue = " + bcTrue); System.out.println("bcFalse = " + bcFalse); }
From source file:EditableColumn.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[][] = { { new Integer(1), "ichi", Boolean.TRUE, new Date("01/01/2000"), icon1 }, { new Integer(2), "ni", Boolean.TRUE, new Date("04/15/1999"), icon2 }, { new Integer(3), "san", Boolean.FALSE, new Date("12/07/1941"), icon2 }, { new Integer(4), "shi", Boolean.TRUE, new Date("02/29/2000"), icon1 }, { new Integer(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. j ava2 s . com*/ 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()); } public void setValueAt(Object value, int row, int column) { rowData[row][column] = value; } public boolean isCellEditable(int row, int column) { return (column != 4); } }; 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:EntityReferenceTest.java
public static void main(String[] args) throws Exception { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); inputFactory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE); inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE); XMLStreamReader reader = inputFactory.createXMLStreamReader(new FileInputStream("e.xml")); while (reader.hasNext()) { int event = reader.next(); if (event == XMLStreamConstants.CHARACTERS) System.out.println(reader.getText()); else if (event == XMLStreamConstants.ENTITY_REFERENCE) { System.out.println("en: " + reader.getLocalName()); System.out.println("er: " + reader.getText()); }/* w ww .j a va2 s.c o m*/ } inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE); reader = inputFactory.createXMLStreamReader(new FileInputStream("e.xml")); while (reader.hasNext()) { int event = reader.next(); if (event == XMLStreamConstants.CHARACTERS) System.out.println(reader.getText()); else if (event == XMLStreamConstants.ENTITY_REFERENCE) { System.out.println("en: " + reader.getLocalName()); System.out.println("er: " + reader.getText()); } } }
From source file:com.milkdairy.admin.MilkDairyManagement.java
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { Resource resource = new ClassPathResource("applicationContext.xml"); BeanFactory factory = new XmlBeanFactory(resource); JPanel milkDairyManagementJPanel = (MilkDairyManagementJPanel) factory .getBean("milkDairyManagementJPanel"); UIManager.put("swing.boldmetal", Boolean.FALSE); new LoginJFrame(milkDairyManagementJPanel, (LoggingService) factory.getBean("loggingService")) .setVisible(true);//from w w w .ja v a 2 s . c om } }); }
From source file:Main.java
public static void main(String[] args) { Vector<Double> doubleVector = new Vector<Double>(); Vector<Integer> integerVector = new Vector<Integer>(); Vector<Boolean> booleanVector = new Vector<Boolean>(); Vector<Icon> iconVector = new Vector<Icon>(); Icon icon1 = ((UIManager.getIcon("OptionPane.errorIcon"))); Icon icon2 = (UIManager.getIcon("OptionPane.informationIcon")); Icon icon3 = (UIManager.getIcon("OptionPane.warningIcon")); Icon icon4 = (UIManager.getIcon("OptionPane.questionIcon")); doubleVector.addElement(1.001);/* w w w . ja v a2 s . c o m*/ doubleVector.addElement(10.00); doubleVector.addElement(0.95); doubleVector.addElement(4.2); JComboBox comboBoxDouble = new JComboBox(doubleVector); integerVector.addElement(1); integerVector.addElement(2); integerVector.addElement(3); integerVector.addElement(4); JComboBox comboBoxInteger = new JComboBox(integerVector); booleanVector.add(Boolean.TRUE); booleanVector.add(Boolean.FALSE); JComboBox comboBoxBoolean = new JComboBox(booleanVector); iconVector.addElement(icon1); iconVector.addElement(icon2); iconVector.addElement(icon3); iconVector.addElement(icon4); JComboBox comboBoxIcon = new JComboBox(iconVector); JFrame frame = new JFrame(); frame.setLayout(new GridLayout(2, 2, 5, 5)); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(comboBoxDouble); frame.add(comboBoxInteger); frame.add(comboBoxBoolean); frame.add(comboBoxIcon); frame.pack(); frame.setVisible(true); }
From source file:SimpleAttributeSample.java
public static void main(String args[]) { JFrame frame = new JFrame("Simple Attributes"); Container content = frame.getContentPane(); StyledDocument document = new DefaultStyledDocument(); SimpleAttributeSet attributes = new SimpleAttributeSet(); attributes.addAttribute(StyleConstants.CharacterConstants.Bold, Boolean.TRUE); attributes.addAttribute(StyleConstants.CharacterConstants.Italic, Boolean.TRUE); // Insert content try {/*from ww w .j a v a 2 s .c o m*/ document.insertString(document.getLength(), "Hello Java", attributes); } catch (BadLocationException badLocationException) { System.err.println("Oops"); } attributes = new SimpleAttributeSet(); attributes.addAttribute(StyleConstants.CharacterConstants.Bold, Boolean.FALSE); attributes.addAttribute(StyleConstants.CharacterConstants.Italic, Boolean.FALSE); attributes.addAttribute(StyleConstants.CharacterConstants.Foreground, Color.lightGray); // Insert content try { document.insertString(document.getLength(), " - Good-bye Visual Basic", attributes); } catch (BadLocationException badLocationException) { System.err.println("Oops"); } JTextPane textPane = new JTextPane(document); textPane.setEditable(false); JScrollPane scrollPane = new JScrollPane(textPane); content.add(scrollPane, BorderLayout.CENTER); frame.setSize(300, 150); frame.setVisible(true); }
From source file:Main.java
public static void main(String... args) { Main ft = new Main(); try {/* w w w.ja v a 2 s. c o m*/ Class<?> c = ft.getClass(); Field f = c.getDeclaredField("b"); f.setAccessible(true); // solution f.setBoolean(ft, Boolean.FALSE); // IllegalAccessException // production code should handle these exceptions more gracefully } catch (NoSuchFieldException x) { x.printStackTrace(); } catch (IllegalArgumentException x) { x.printStackTrace(); } catch (IllegalAccessException x) { x.printStackTrace(); } }