19.09.2015 Views

Prentice.Hall.Introduction.to.Java.Programming,.Brief.Version.9th.(2014).[sharethefiles.com]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(a)<br />

(b)<br />

Figure 40.14<br />

You can add a new column in a table.<br />

The Delete Selected Row but<strong>to</strong>n deletes the first selected row.<br />

The Delete Selected Column but<strong>to</strong>n deletes the first selected<br />

column.<br />

The Save but<strong>to</strong>n saves the current table data and column names.<br />

The Clear but<strong>to</strong>n clears the row data in the table. The Res<strong>to</strong>re<br />

but<strong>to</strong>n res<strong>to</strong>res the saved table.<br />

Listing 40.6 gives the program.<br />

Listing 40.6 ModifyTable.java<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

1 import java.awt.*;<br />

2 import java.awt.event.*;<br />

3 import javax.swing.*;<br />

4 import javax.swing.table.*;<br />

5 import java.io.*;<br />

6 import java.util.Vec<strong>to</strong>r;<br />

7<br />

8 public class ModifyTable extends JApplet {<br />

16

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

Saved successfully!

Ooh no, something went wrong!