2011-05-19 43 views
0

你好,我想顯示我的文件數據到按鈕之前,此面板「一口價」文本JTable中

這裏是我的代碼:

package program; 

import java.awt.Container; 
import java.awt.FlowLayout;  
import javax.swing.JApplet; 
import javax.swing.JButton; 
import javax.swing.JFrame; 

public class Button1 extends JApplet { 
    private static final String EXT_FILE = "Dogss.txt";//"../ApplicationESB/src/applicationesb/pricelist.txt"; 


    private JButton b1 = new JButton("Buy it");  

    public void init() { 
    Container cp = getContentPane(); 
    cp.setLayout(new FlowLayout()); 
    cp.add(b1); 

    }  

    public static void main(String[] args) { 
    run(new Button1(), 500, 600); 
    } 

    public static void run(JApplet applet, int width, int height) { 
    JFrame frame = new JFrame(); 
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
    frame.getContentPane().add(applet); 
    frame.setSize(width, height); 
    applet.init(); 
    applet.start(); 
    frame.setVisible(true); 
    } 
} 
+1

您有問題要問? – 2011-05-19 17:15:51

回答