当前位置: 技术问答>java相关
关于表格代码的转换
来源: 互联网 发布时间:2017-04-21
本文导语: 做了一个应用程序的表格代码,但转换在Applet时,却始终有错误,希望能给予转换,代码如下所示: import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; import java.text.*; import javax.swing.*; import javax.swing....
做了一个应用程序的表格代码,但转换在Applet时,却始终有错误,希望能给予转换,代码如下所示:
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.text.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.table.*;
public class StocksTable extends JFrame {
protected JTable m_table;
protected StockTableData m_data;
protected JLabel m_title;
public StocksTable() {
super("Stocks Table");
setSize(600, 300);
m_data = new StockTableData();
m_title = new JLabel(m_data.getTitle(),
new ImageIcon("money.gif"), SwingConstants.CENTER);
m_title.setFont(new Font("Helvetica",Font.PLAIN,24));
m_title.setForeground(Color.black);
getContentPane().add(m_title, BorderLayout.NORTH);
m_table = new JTable();
m_table.setAutoCreateColumnsFromModel(false);
m_table.setModel(m_data);
for (int k = 0; k
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.text.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.table.*;
public class StocksTable extends JFrame {
protected JTable m_table;
protected StockTableData m_data;
protected JLabel m_title;
public StocksTable() {
super("Stocks Table");
setSize(600, 300);
m_data = new StockTableData();
m_title = new JLabel(m_data.getTitle(),
new ImageIcon("money.gif"), SwingConstants.CENTER);
m_title.setFont(new Font("Helvetica",Font.PLAIN,24));
m_title.setForeground(Color.black);
getContentPane().add(m_title, BorderLayout.NORTH);
m_table = new JTable();
m_table.setAutoCreateColumnsFromModel(false);
m_table.setModel(m_data);
for (int k = 0; k