JTable 的TableModel (使用TMF框架只用一行代码)
来源:互联网 发布:php 抓取搜狗微信文章 编辑:程序博客网 时间:2024/05/14 15:07
简单实用:
使用JTable再也不用写TableModel了,只写一个XML文件另一行java代码就可以了.
一般读取数据都是这样:
List result=new ArrayList();
JavaBean b=new JavaBean();
b.setA("A");
result.add(b);
xml文件配置的是要显示的列,不需要显示的,只要把相应的XML代码删除就可以了.
所用的包:
castor-0.9.5.3-xml.jar
commons-collections-3.1.jar
hr.jar
j2x.jar
xml.jar
package com.andnnl;
/** *//**
* The EmployeeVO contains all the information about an employee.
* @author MAbernethy
*/
public class EmployeeVO
...{
private String firstName;
private String lastName;
private int bandLevel;
private int yearsService;
private java.math.BigDecimal salary;
private String address;
private String state;
private int zipCode;
private boolean married;
/** *//**
* Gets the address.
* @return the address
*/
public String getAddress()
...{
return address;
}
/** *//**
* Gets the band level.
* @return the band level
*/
public int getBandLevel()
...{
return bandLevel;
}
/** *//**
* Gets the first name.
* @return the first name
*/
public String getFirstName()
...{
return firstName;
}
/** *//**
* Gets the last name.
* @return the last name
*/
public String getLastName()
...{
return lastName;
}
/** *//**
* Gets the married status.
* @return the married status
*/
public boolean isMarried()
...{
return married;
}
/** *//**
* Gets the salary.
* @return the salary
*/
public java.math.BigDecimal getSalary()
...{
return salary;
}
/** *//**
* Gets the state.
* @return the state
*/
public String getState()
...{
return state;
}
/** *//**
* Gets the years of service.
* @return the years of service
*/
public int getYearsService()
...{
return yearsService;
}
/** *//**
* Gets the zip code
* @return the zip code
*/
public int getZipCode()
...{
return zipCode;
}
/** *//**
* Sets the address.
* @param string the address
*/
public void setAddress(String string)
...{
address = string;
}
/** *//**
* Sets the band level
* @param i the band level
*/
public void setBandLevel(int i)
...{
bandLevel = i;
}
/** *//**
* Sets the first name
* @param string the first name
*/
public void setFirstName(String string)
...{
firstName = string;
}
/** *//**
* Sets the last name
* @param string the last name
*/
public void setLastName(String string)
...{
lastName = string;
}
/** *//**
* Sets the married status.
* @param b the married status
*/
public void setMarried(boolean b)
...{
married = b;
}
/** *//**
* Sets the salary.
* @param decimal the salary
*/
public void setSalary(java.math.BigDecimal decimal)
...{
salary = decimal;
}
/** *//**
* Sets the state.
* @param string the state
*/
public void setState(String string)
...{
state = string;
}
/** *//**
* Sets the years of service.
* @param i the service
*/
public void setYearsService(int i)
...{
yearsService = i;
}
/** *//**
* Sets the zip code.
* @param i the zip code
*/
public void setZipCode(int i)
...{
zipCode = i;
}
}
/** *//**
* The EmployeeVO contains all the information about an employee.
* @author MAbernethy
*/
public class EmployeeVO
...{
private String firstName;
private String lastName;
private int bandLevel;
private int yearsService;
private java.math.BigDecimal salary;
private String address;
private String state;
private int zipCode;
private boolean married;
/** *//**
* Gets the address.
* @return the address
*/
public String getAddress()
...{
return address;
}
/** *//**
* Gets the band level.
* @return the band level
*/
public int getBandLevel()
...{
return bandLevel;
}
/** *//**
* Gets the first name.
* @return the first name
*/
public String getFirstName()
...{
return firstName;
}
/** *//**
* Gets the last name.
* @return the last name
*/
public String getLastName()
...{
return lastName;
}
/** *//**
* Gets the married status.
* @return the married status
*/
public boolean isMarried()
...{
return married;
}
/** *//**
* Gets the salary.
* @return the salary
*/
public java.math.BigDecimal getSalary()
...{
return salary;
}
/** *//**
* Gets the state.
* @return the state
*/
public String getState()
...{
return state;
}
/** *//**
* Gets the years of service.
* @return the years of service
*/
public int getYearsService()
...{
return yearsService;
}
/** *//**
* Gets the zip code
* @return the zip code
*/
public int getZipCode()
...{
return zipCode;
}
/** *//**
* Sets the address.
* @param string the address
*/
public void setAddress(String string)
...{
address = string;
}
/** *//**
* Sets the band level
* @param i the band level
*/
public void setBandLevel(int i)
...{
bandLevel = i;
}
/** *//**
* Sets the first name
* @param string the first name
*/
public void setFirstName(String string)
...{
firstName = string;
}
/** *//**
* Sets the last name
* @param string the last name
*/
public void setLastName(String string)
...{
lastName = string;
}
/** *//**
* Sets the married status.
* @param b the married status
*/
public void setMarried(boolean b)
...{
married = b;
}
/** *//**
* Sets the salary.
* @param decimal the salary
*/
public void setSalary(java.math.BigDecimal decimal)
...{
salary = decimal;
}
/** *//**
* Sets the state.
* @param string the state
*/
public void setState(String string)
...{
state = string;
}
/** *//**
* Sets the years of service.
* @param i the service
*/
public void setYearsService(int i)
...{
yearsService = i;
}
/** *//**
* Sets the zip code.
* @param i the zip code
*/
public void setZipCode(int i)
...{
zipCode = i;
}
}
package com.andnnl;
/** *//**
* The EmployeeGenerator randomly pieces together employee information to produce a random employee.
* @author MAbernethy
*/
public class EmployeeGenerator
...{
private static String[] states = ...{"TX", "PA", "NC", "AK", "AR", "AZ", "MD", "SD", "SC", "FL", "AL", "CA", "NV" };
private static String[] first = ...{"Allen", "Carmelo", "LeBron", "Lamar", "Tim", "Carlos", "Stephon", "Emeka", "Richard", "Amare" };
private static String[] last = ...{"Holmes", "Tomlinson", "Portis", "Alexander", "Green", "McAllister", "James", "Lewis", "Faulk", "Bennett", "Henry", "Davis", "Dillon", "Taylor", "Johnson"};
private static String[] address = ...{"550 Elm St", "1 Main Str", "742 Evergreen Terrace", "1600 Pennsylvania Dr", "10 Downing Str", "550 5th Ave" };
/** *//**
* Pieces together random information to form an EmployeeVO
* @return the random Employee
*/
public static EmployeeVO getNewEmployee()
...{
EmployeeVO empVO = new EmployeeVO();
empVO.setAddress(getRandomAddress());
empVO.setBandLevel(getRandomBandLevel());
empVO.setFirstName(getRandomFirstName());
empVO.setLastName(getRandomLastName());
empVO.setMarried(getRandomMarried());
empVO.setSalary(getRandomSalary());
empVO.setState(getRandomState());
empVO.setYearsService(getRandomService());
empVO.setZipCode(getRandomZip());
return empVO;
}
private static String getRandomFirstName()
...{
return first[(int)(Math.random() * first.length)];
}
private static String getRandomLastName()
...{
return last[(int)(Math.random() * last.length)];
}
private static int getRandomBandLevel()
...{
return (int)(Math.random() * 10);
}
private static int getRandomService()
...{
return (int)(Math.random() * 25);
}
private static java.math.BigDecimal getRandomSalary()
...{
return new java.math.BigDecimal(Math.random() * 100000).setScale(2, java.math.BigDecimal.ROUND_HALF_UP);
}
private static String getRandomAddress()
...{
return address[(int)(Math.random() * address.length)];
}
private static String getRandomState()
...{
return states[(int)(Math.random() * states.length)];
}
private static int getRandomZip()
...{
return (int)(Math.random() * 100000);
}
private static boolean getRandomMarried()
...{
return (((int)(Math.random()*2)) % 2 == 0);
}
}
/** *//**
* The EmployeeGenerator randomly pieces together employee information to produce a random employee.
* @author MAbernethy
*/
public class EmployeeGenerator
...{
private static String[] states = ...{"TX", "PA", "NC", "AK", "AR", "AZ", "MD", "SD", "SC", "FL", "AL", "CA", "NV" };
private static String[] first = ...{"Allen", "Carmelo", "LeBron", "Lamar", "Tim", "Carlos", "Stephon", "Emeka", "Richard", "Amare" };
private static String[] last = ...{"Holmes", "Tomlinson", "Portis", "Alexander", "Green", "McAllister", "James", "Lewis", "Faulk", "Bennett", "Henry", "Davis", "Dillon", "Taylor", "Johnson"};
private static String[] address = ...{"550 Elm St", "1 Main Str", "742 Evergreen Terrace", "1600 Pennsylvania Dr", "10 Downing Str", "550 5th Ave" };
/** *//**
* Pieces together random information to form an EmployeeVO
* @return the random Employee
*/
public static EmployeeVO getNewEmployee()
...{
EmployeeVO empVO = new EmployeeVO();
empVO.setAddress(getRandomAddress());
empVO.setBandLevel(getRandomBandLevel());
empVO.setFirstName(getRandomFirstName());
empVO.setLastName(getRandomLastName());
empVO.setMarried(getRandomMarried());
empVO.setSalary(getRandomSalary());
empVO.setState(getRandomState());
empVO.setYearsService(getRandomService());
empVO.setZipCode(getRandomZip());
return empVO;
}
private static String getRandomFirstName()
...{
return first[(int)(Math.random() * first.length)];
}
private static String getRandomLastName()
...{
return last[(int)(Math.random() * last.length)];
}
private static int getRandomBandLevel()
...{
return (int)(Math.random() * 10);
}
private static int getRandomService()
...{
return (int)(Math.random() * 25);
}
private static java.math.BigDecimal getRandomSalary()
...{
return new java.math.BigDecimal(Math.random() * 100000).setScale(2, java.math.BigDecimal.ROUND_HALF_UP);
}
private static String getRandomAddress()
...{
return address[(int)(Math.random() * address.length)];
}
private static String getRandomState()
...{
return states[(int)(Math.random() * states.length)];
}
private static int getRandomZip()
...{
return (int)(Math.random() * 100000);
}
private static boolean getRandomMarried()
...{
return (((int)(Math.random()*2)) % 2 == 0);
}
}
package com.andnnl;
/** *//**
* The EmployeeGenerator randomly pieces together employee information to produce a random employee.
* @author MAbernethy
*/
public class EmployeeGenerator2
...{
private static String[] states = ...{"TX", "PA", "NC", "AK", "AR", "AZ", "MD", "SD", "SC", "FL", "AL", "CA", "NV" };
private static String[] first = ...{"Allen", "Carmelo", "LeBron", "Lamar", "Tim", "Carlos", "Stephon", "Emeka", "Richard", "Amare" };
private static String[] last = ...{"Holmes", "Tomlinson", "Portis", "Alexander", "Green", "McAllister", "James", "Lewis", "Faulk", "Bennett", "Henry", "Davis", "Dillon", "Taylor", "Johnson"};
private static String[] address = ...{"550 Elm St", "1 Main Str", "742 Evergreen Terrace", "1600 Pennsylvania Dr", "10 Downing Str", "550 5th Ave" };
/** *//**
* Pieces together random information to form an EmployeeVO
* @return the random Employee
*/
public static EmployeeVO2 getNewEmployee()
...{
EmployeeVO2 empVO = new EmployeeVO2();
empVO.setAddress(getRandomAddress());
empVO.setBandLevel(getRandomBandLevel());
empVO.setFirstName(getRandomFirstName());
empVO.setLastName(getRandomLastName());
empVO.setMarried(getRandomMarried());
empVO.setSalary(getRandomSalary());
empVO.setState(getRandomState());
empVO.setYearsService(getRandomService());
empVO.setZipCode(getRandomZip());
return empVO;
}
private static String getRandomFirstName()
...{
return first[(int)(Math.random() * first.length)];
}
private static String getRandomLastName()
...{
return last[(int)(Math.random() * last.length)];
}
private static int getRandomBandLevel()
...{
return (int)(Math.random() * 10);
}
private static int getRandomService()
...{
return (int)(Math.random() * 25);
}
private static java.math.BigDecimal getRandomSalary()
...{
return new java.math.BigDecimal(Math.random() * 100000).setScale(2, java.math.BigDecimal.ROUND_HALF_UP);
}
private static String getRandomAddress()
...{
return address[(int)(Math.random() * address.length)];
}
private static String getRandomState()
...{
return states[(int)(Math.random() * states.length)];
}
private static int getRandomZip()
...{
return (int)(Math.random() * 100000);
}
private static boolean getRandomMarried()
...{
return (((int)(Math.random()*2)) % 2 == 0);
}
}
/** *//**
* The EmployeeGenerator randomly pieces together employee information to produce a random employee.
* @author MAbernethy
*/
public class EmployeeGenerator2
...{
private static String[] states = ...{"TX", "PA", "NC", "AK", "AR", "AZ", "MD", "SD", "SC", "FL", "AL", "CA", "NV" };
private static String[] first = ...{"Allen", "Carmelo", "LeBron", "Lamar", "Tim", "Carlos", "Stephon", "Emeka", "Richard", "Amare" };
private static String[] last = ...{"Holmes", "Tomlinson", "Portis", "Alexander", "Green", "McAllister", "James", "Lewis", "Faulk", "Bennett", "Henry", "Davis", "Dillon", "Taylor", "Johnson"};
private static String[] address = ...{"550 Elm St", "1 Main Str", "742 Evergreen Terrace", "1600 Pennsylvania Dr", "10 Downing Str", "550 5th Ave" };
/** *//**
* Pieces together random information to form an EmployeeVO
* @return the random Employee
*/
public static EmployeeVO2 getNewEmployee()
...{
EmployeeVO2 empVO = new EmployeeVO2();
empVO.setAddress(getRandomAddress());
empVO.setBandLevel(getRandomBandLevel());
empVO.setFirstName(getRandomFirstName());
empVO.setLastName(getRandomLastName());
empVO.setMarried(getRandomMarried());
empVO.setSalary(getRandomSalary());
empVO.setState(getRandomState());
empVO.setYearsService(getRandomService());
empVO.setZipCode(getRandomZip());
return empVO;
}
private static String getRandomFirstName()
...{
return first[(int)(Math.random() * first.length)];
}
private static String getRandomLastName()
...{
return last[(int)(Math.random() * last.length)];
}
private static int getRandomBandLevel()
...{
return (int)(Math.random() * 10);
}
private static int getRandomService()
...{
return (int)(Math.random() * 25);
}
private static java.math.BigDecimal getRandomSalary()
...{
return new java.math.BigDecimal(Math.random() * 100000).setScale(2, java.math.BigDecimal.ROUND_HALF_UP);
}
private static String getRandomAddress()
...{
return address[(int)(Math.random() * address.length)];
}
private static String getRandomState()
...{
return states[(int)(Math.random() * states.length)];
}
private static int getRandomZip()
...{
return (int)(Math.random() * 100000);
}
private static boolean getRandomMarried()
...{
return (((int)(Math.random()*2)) % 2 == 0);
}
}
package com.andnnl;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import com.ibm.j2x.swing.util.TableUtilities;
public class TableModelTest extends JFrame ...{
private List data;
private JTable table;
private int flag=0;
/** *//**
* Launch the application
* @param args
*/
public static void main(String args[]) ...{
try ...{
TableModelTest frame = new TableModelTest();
frame.setVisible(true);
} catch (Exception e) ...{
e.printStackTrace();
}
}
/** *//**
* Create the frame
*/
public TableModelTest() ...{
super();
setBounds(100, 100, 500, 375);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
getContentPane().add(panel, BorderLayout.CENTER);
final JScrollPane scrollPane = new JScrollPane();
panel.add(scrollPane, BorderLayout.CENTER);
table = new JTable();
scrollPane.setViewportView(table);
//
final JButton button = new JButton();
button.addActionListener(new ActionListener() ...{
public void actionPerformed(ActionEvent e) ...{
change();
}
});
button.setText("New JButton");
panel.add(button, BorderLayout.NORTH);
}
protected void change() ...{
if(flag==0)...{
data = new ArrayList();
for (int i=0; i<25; i++)
data.add(EmployeeGenerator.getNewEmployee());
TableUtilities.setViewToModel("resources/evil_hr_table.xml", "Personal", table, data);
flag=1;
}else...{
data = new ArrayList();
for (int i=0; i<25; i++)
data.add(EmployeeGenerator2.getNewEmployee());
flag=0;
TableUtilities.setViewToModel("resources/evil_hr_table.xml", "Hire", table, data);
}
}
}
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import com.ibm.j2x.swing.util.TableUtilities;
public class TableModelTest extends JFrame ...{
private List data;
private JTable table;
private int flag=0;
/** *//**
* Launch the application
* @param args
*/
public static void main(String args[]) ...{
try ...{
TableModelTest frame = new TableModelTest();
frame.setVisible(true);
} catch (Exception e) ...{
e.printStackTrace();
}
}
/** *//**
* Create the frame
*/
public TableModelTest() ...{
super();
setBounds(100, 100, 500, 375);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
getContentPane().add(panel, BorderLayout.CENTER);
final JScrollPane scrollPane = new JScrollPane();
panel.add(scrollPane, BorderLayout.CENTER);
table = new JTable();
scrollPane.setViewportView(table);
//
final JButton button = new JButton();
button.addActionListener(new ActionListener() ...{
public void actionPerformed(ActionEvent e) ...{
change();
}
});
button.setText("New JButton");
panel.add(button, BorderLayout.NORTH);
}
protected void change() ...{
if(flag==0)...{
data = new ArrayList();
for (int i=0; i<25; i++)
data.add(EmployeeGenerator.getNewEmployee());
TableUtilities.setViewToModel("resources/evil_hr_table.xml", "Personal", table, data);
flag=1;
}else...{
data = new ArrayList();
for (int i=0; i<25; i++)
data.add(EmployeeGenerator2.getNewEmployee());
flag=0;
TableUtilities.setViewToModel("resources/evil_hr_table.xml", "Hire", table, data);
}
}
}
package com.andnnl;
/** *//**
* The EmployeeVO contains all the information about an employee.
* @author MAbernethy
*/
public class EmployeeVO2
...{
private String firstName;
private String lastName;
private int bandLevel;
private int yearsService;
private java.math.BigDecimal salary;
private String address;
private String state;
private int zipCode;
private boolean married;
/** *//**
* Gets the address.
* @return the address
*/
public String getAddress()
...{
return address;
}
/** *//**
* Gets the band level.
* @return the band level
*/
public int getBandLevel()
...{
return bandLevel;
}
/** *//**
* Gets the first name.
* @return the first name
*/
public String getFirstName()
...{
return firstName;
}
/** *//**
* Gets the last name.
* @return the last name
*/
public String getLastName()
...{
return lastName;
}
/** *//**
* Gets the married status.
* @return the married status
*/
public boolean isMarried()
...{
return married;
}
/** *//**
* Gets the salary.
* @return the salary
*/
public java.math.BigDecimal getSalary()
...{
return salary;
}
/** *//**
* Gets the state.
* @return the state
*/
public String getState()
...{
return state;
}
/** *//**
* Gets the years of service.
* @return the years of service
*/
public int getYearsService()
...{
return yearsService;
}
/** *//**
* Gets the zip code
* @return the zip code
*/
public int getZipCode()
...{
return zipCode;
}
/** *//**
* Sets the address.
* @param string the address
*/
public void setAddress(String string)
...{
address = string;
}
/** *//**
* Sets the band level
* @param i the band level
*/
public void setBandLevel(int i)
...{
bandLevel = i;
}
/** *//**
* Sets the first name
* @param string the first name
*/
public void setFirstName(String string)
...{
firstName = string;
}
/** *//**
* Sets the last name
* @param string the last name
*/
public void setLastName(String string)
...{
lastName = string;
}
/** *//**
* Sets the married status.
* @param b the married status
*/
public void setMarried(boolean b)
...{
married = b;
}
/** *//**
* Sets the salary.
* @param decimal the salary
*/
public void setSalary(java.math.BigDecimal decimal)
...{
salary = decimal;
}
/** *//**
* Sets the state.
* @param string the state
*/
public void setState(String string)
...{
state = string;
}
/** *//**
* Sets the years of service.
* @param i the service
*/
public void setYearsService(int i)
...{
yearsService = i;
}
/** *//**
* Sets the zip code.
* @param i the zip code
*/
public void setZipCode(int i)
...{
zipCode = i;
}
}
/** *//**
* The EmployeeVO contains all the information about an employee.
* @author MAbernethy
*/
public class EmployeeVO2
...{
private String firstName;
private String lastName;
private int bandLevel;
private int yearsService;
private java.math.BigDecimal salary;
private String address;
private String state;
private int zipCode;
private boolean married;
/** *//**
* Gets the address.
* @return the address
*/
public String getAddress()
...{
return address;
}
/** *//**
* Gets the band level.
* @return the band level
*/
public int getBandLevel()
...{
return bandLevel;
}
/** *//**
* Gets the first name.
* @return the first name
*/
public String getFirstName()
...{
return firstName;
}
/** *//**
* Gets the last name.
* @return the last name
*/
public String getLastName()
...{
return lastName;
}
/** *//**
* Gets the married status.
* @return the married status
*/
public boolean isMarried()
...{
return married;
}
/** *//**
* Gets the salary.
* @return the salary
*/
public java.math.BigDecimal getSalary()
...{
return salary;
}
/** *//**
* Gets the state.
* @return the state
*/
public String getState()
...{
return state;
}
/** *//**
* Gets the years of service.
* @return the years of service
*/
public int getYearsService()
...{
return yearsService;
}
/** *//**
* Gets the zip code
* @return the zip code
*/
public int getZipCode()
...{
return zipCode;
}
/** *//**
* Sets the address.
* @param string the address
*/
public void setAddress(String string)
...{
address = string;
}
/** *//**
* Sets the band level
* @param i the band level
*/
public void setBandLevel(int i)
...{
bandLevel = i;
}
/** *//**
* Sets the first name
* @param string the first name
*/
public void setFirstName(String string)
...{
firstName = string;
}
/** *//**
* Sets the last name
* @param string the last name
*/
public void setLastName(String string)
...{
lastName = string;
}
/** *//**
* Sets the married status.
* @param b the married status
*/
public void setMarried(boolean b)
...{
married = b;
}
/** *//**
* Sets the salary.
* @param decimal the salary
*/
public void setSalary(java.math.BigDecimal decimal)
...{
salary = decimal;
}
/** *//**
* Sets the state.
* @param string the state
*/
public void setState(String string)
...{
state = string;
}
/** *//**
* Sets the years of service.
* @param i the service
*/
public void setYearsService(int i)
...{
yearsService = i;
}
/** *//**
* Sets the zip code.
* @param i the zip code
*/
public void setZipCode(int i)
...{
zipCode = i;
}
}
<?xml version="1.0" encoding="GB2312" ?>
<!-- Put your Table column mappings here -->
<data>
<model>
<className>demo.hr.TableModelFreeExample</className>
<name>Hire</name>
<column>
<name>蛾眉</name>
<field>firstName</field>
</column>
<column>
<name>Last Name</name>
<field>lastName</field>
</column>
</model>
<model>
<className>demo.hr.TableModelFreeExample</className>
<name>Personal</name>
<column>
<name>名称</name>
<field>firstName</field>
</column>
<column>
<name>Last Name</name>
<field>lastName</field>
</column>
<column>
<name>Street Address</name>
<field>address</field>
</column>
<column>
<name>State</name>
<field>state</field>
</column>
<column>
<name>Zip</name>
<field>zipCode</field>
</column>
<column>
<name>Married?</name>
<field>married</field>
</column>
</model>
<model>
<className>demo.hr.TableModelFreeExample</className>
<name>Financial</name>
<column>
<name>Last Name</name>
<field>lastName</field>
</column>
<column>
<name>First Name</name>
<field>firstName</field>
</column>
<column>
<name>Band Level</name>
<field>bandLevel</field>
</column>
<column>
<name>Years of Service</name>
<field>yearsService</field>
</column>
<column>
<name>Salary</name>
<field>salary</field>
</column>
</model>
</data>
<!-- Put your Table column mappings here -->
<data>
<model>
<className>demo.hr.TableModelFreeExample</className>
<name>Hire</name>
<column>
<name>蛾眉</name>
<field>firstName</field>
</column>
<column>
<name>Last Name</name>
<field>lastName</field>
</column>
</model>
<model>
<className>demo.hr.TableModelFreeExample</className>
<name>Personal</name>
<column>
<name>名称</name>
<field>firstName</field>
</column>
<column>
<name>Last Name</name>
<field>lastName</field>
</column>
<column>
<name>Street Address</name>
<field>address</field>
</column>
<column>
<name>State</name>
<field>state</field>
</column>
<column>
<name>Zip</name>
<field>zipCode</field>
</column>
<column>
<name>Married?</name>
<field>married</field>
</column>
</model>
<model>
<className>demo.hr.TableModelFreeExample</className>
<name>Financial</name>
<column>
<name>Last Name</name>
<field>lastName</field>
</column>
<column>
<name>First Name</name>
<field>firstName</field>
</column>
<column>
<name>Band Level</name>
<field>bandLevel</field>
</column>
<column>
<name>Years of Service</name>
<field>yearsService</field>
</column>
<column>
<name>Salary</name>
<field>salary</field>
</column>
</model>
</data>
- JTable 的TableModel (使用TMF框架只用一行代码)
- JTable简单介绍,以及tableModel的使用
- 浅析JTable与TableModel、TableCellRenderer、TableCellEditor接口——使用JComboBox显示单元格的值
- 浅析JTable与TableModel、TableCellRenderer、TableCellEditor接口——使用JComboBox显示单元格的值
- 浅析JTable与TableModel、TableCellRenderer、TableCellEditor接口——使用JComboBox显示单元格的值
- 用 TableModel Free 框架简化 Swing 开发——JTable
- JTable和TableModel
- TableModel.JTable和AbstractTableModel
- JTable和TableModel
- 改变JTable一行的颜色
- 浅谈Java.swing.JTable.TableModel和AbstractTableModel
- swing JTable学习(六)—tableModel firechange
- JavaSwing 表格JTable内容居中 自定义TableModel
- Java swing之JTable与TableModel
- JTable的使用
- JTable的使用
- JTable的基本使用
- JTable的使用
- 演练VC中的COMMON一族(转贴)之一 选择自 happyparrot 的 Blog
- 好啊,同志们!
- C#编码标准--编码习惯
- web.cofig的设置(收集中)
- Csdn我来了!
- JTable 的TableModel (使用TMF框架只用一行代码)
- GridView导出Excel研究
- 创建不规则窗体和控件
- ASP.NET如何获取远程图片
- 假如你想输入一个用户姓名,那么如何用C#语言判断该姓名在数据库中是存在的呢?
- Linux那些事儿之我是UHCI(20)非Root Hub的Bulk传输
- 关于ASP.NET技术的学习顺序问题(转)
- qt4:windows下编译qt4的mysql5驱动程序的错误解决
- 简单驱动开发配置