資源簡介
java寫的一個界面操作的背包,輸入背包的大小和每個裝入背包物品的體積大小然后輸出所有的解
代碼片段和文件信息
package?test;
import?java.awt.Color;
import?java.awt.GridLayout;
import?java.awt.event.ActionEvent;
import?java.awt.event.ActionListener;
import?java.util.Vector;
import?javax.swing.JButton;
import?javax.swing.Jframe;
import?javax.swing.JLabel;
import?javax.swing.JOptionPane;
import?javax.swing.JPanel;
import?javax.swing.JScrollPane;
import?javax.swing.JTextArea;
import?javax.swing.JTextField;
import?javax.swing.SwingConstants;
import?javax.swing.border.titledBorder;
public?class?Beibao?extends?Jframe?{
static?JTextField?t_v;
static?JTextField?t_number;
JButton?b_confirm?b_reset;
JScrollPane?myScrollPane;
static?JTextArea?myTextArea;
JPanel?myPanel1;
JPanel?myPanel2;
JLabel?b_v?b_number;
public?Beibao()?{//?設計界面,實現事件監聽
t_v?=?new?JTextFie
評論
共有 條評論