23.07.2013 Views

Java IO.pdf - Nguyen Dang Binh

Java IO.pdf - Nguyen Dang Binh

Java IO.pdf - Nguyen Dang Binh

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

}<br />

System.exit(0);<br />

Figure 13.5. A JFileChooser with a TextFilePreview accessory<br />

13.2.14 Swing Methods<br />

<strong>Java</strong> I/O<br />

Like most Swing components, JFileChooser has several methods for working with the look<br />

and feel. The updateUI() method is invoked if the look and feel has changed, to tell the<br />

component to redraw itself:<br />

public void updateUI()<br />

The getUIClassID() method returns the name of the look-and-feel class that drew this file<br />

chooser:<br />

public String getUIClassID()<br />

The getUI() method returns the actual object that implements the particular look and feel:<br />

public FileChooserUI getUI()<br />

It's unlikely you'll need to call any of these three methods directly.<br />

getAccessibleContext() returns the com.sun.java.accessibility.AccessibleContext<br />

object used to provide handicapped accessibility for the component:<br />

public AccessibleContext getAccessibleContext()<br />

330

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!