java - Undo option in Jtable -


I'm a newbie in java and swing and I'm trying to make a jettble and I apply a reverse option to it. Want to do Is it possible that I store table models in some part of the operation and later when I press a undo button or something, then I can set the saved table model so that it performs like a revert .

Thanks

You can try this code. It depends on the tableclistlist code that you will find in the link given below:

  The public class Miman extends JFrame {Private Static last long serial VERSIONUID = 1L; DefaultTel Model Model; Joint Tables; String call [] = {"name", "address", "phone"}; Action Action = New Object Action () {Private Static Finals Long Serial Weerission UID = 1 L; Public Zero Workflow (Action EVE) {Tableclaimener TCL = (Tablesellist) e.getSource (); System.out.println ("Line:" + tcl.getRow ()); System.out.println ("Columns:" + tcl.getColumn ()); System.out.println ("old:" + tcl.getOldValue ()); System.out.println ("new:" + tcl.getNewValue ()); }}; Public Static Zero Main (string [] args throws IOException {New MyMain (). Start (); } Public Zero Starter () {Model = New DefaultTableModel (call, 50); Table = New JTable (Model) {Private Stable Last Long Serial VERSIONUID = 1 L; @ Override Public Boolean Kossel Asset (Int oder 0, IntraT 1 arg1) {Return Truth; }}; JScrollPane pane = new JScrollPane (table); Tableclass Listener TCL = New Tablesellist (Table, Action); (Pane) adding; SetVisible (true); Set size (500, 400); Setout (new flow layout ()); SetDefaultCloseOperation (EXIT_ON_CLOSE); }}    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -