📄 clothessquaredlg.java
字号:
package view.dialog.getClothes;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JDialog;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import view.common.CenterWindow;
import view.frame.MainFrame;
import view.panel.basePanel.SquarePanel;
import view.panel.getClothes.GetClothesPanel;
import control.getClothes.ClothesSquareListener;
public class ClothesSquareDlg extends JDialog{
private SquarePanel squarePanel;
private GetClothesPanel getClothesPanel;
private String moneyAmount;
public ClothesSquareDlg(GetClothesPanel getClothesPanel){
super(MainFrame.getMainFrame(),"结算",true);
squarePanel = new SquarePanel();
this.getClothesPanel = getClothesPanel;
this.moneyAmount = getClothesPanel.buildMoneyLabel().getText();
squarePanel.buildTotalFundLb().setText(moneyAmount);
squarePanel.buildReceivedFundTxFld().setText(moneyAmount);
this.add(squarePanel);
this.setSize(300,200);
this.pack();
initialize();
CenterWindow.centerWindow(this);
squarePanel.buildOkBtn().addActionListener(new ClothesSquareListener(this));
squarePanel.buildCancelBtn().addActionListener(new ClothesSquareListener(this));
squarePanel.buildReceivedFundTxFld().addCaretListener(new CaretListener(){
public void caretUpdate(CaretEvent arg0) {
double change = Double.parseDouble(squarePanel.buildReceivedFundTxFld().getText())
- Double.parseDouble(squarePanel.buildTotalFundLb().getText());
squarePanel.buildChangeLb().setText(new Double(change).toString());
}
});
this.addWindowListener(new WindowAdapter(){
public void windowDeiconified(WindowEvent e){}
public void windowIconified(WindowEvent we){}
public void windowClosing(WindowEvent we){
we.getWindow().dispose();
}
});
}
public GetClothesPanel getGetClothesPanel(){
return getClothesPanel;
}
public void initialize(){
squarePanel.buildTotalFundLb().setText(new Double(moneyAmount).toString());
squarePanel.buildReceivedFundTxFld().setText(new Double(moneyAmount).toString());
if(getClothesPanel.getOrderVo().getCustomerId() != 0)
squarePanel.buildPayMannerLabel().setText("刷卡");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -