📄 bookbook.java
字号:
org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3Layout.createSequentialGroup()
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 89, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanelRightBottom.add(jPanel3, "card3");
jSplitPaneRight.setRightComponent(jPanelRightBottom);
JsplitPane.setRightComponent(jSplitPaneRight);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(JsplitPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.add(JsplitPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 581, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButtonEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEditActionPerformed
// TODO 将在此处添加您的处理代码:
this.setState1(true);
this.jListCardList.setEnabled(true);
this.jButtonDel.setEnabled(true);
this.jButtonRemove.setEnabled(true);
this.jButtonEdit.setEnabled(true);
String Name=(String)this.jListCardList.getSelectedValue();
if(Name!=null) {
this.vecListCard.remove(Name);
this.jListCardList.setListData(vecListCard);
/* CardInfo1 cardinfo=this.getCardInf1();
hashCardInfo.put(cardinfo.getname(),cardinfo);
String name=this.jTextFieldname.getText().trim();
if(name!=null&&!name.equals(""))
{
this.vecListCard.add(name);
this.jListCardList.setListData(this.vecListCard);
} */
}
}//GEN-LAST:event_jButtonEditActionPerformed
private void jListCardListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jListCardListValueChanged
// TODO 将在此处添加您的处理代码:
String selectedCardName=(String)jListCardList.getSelectedValue();
CardInfo1 cardinfo=(CardInfo1)hashCardInfo.get(selectedCardName);
this.setCardInfo(cardinfo);
}//GEN-LAST:event_jListCardListValueChanged
private void jRadioButton6ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButton6ItemStateChanged
// TODO 将在此处添加您的处理代码:
((CardLayout)jPanelRightBottom.getLayout()).show(jPanelRightBottom,"card3");
}//GEN-LAST:event_jRadioButton6ItemStateChanged
public class CardInfo1{
private String name;
public void setname(String name)
{ this.name=name; }
public String getname()
{ return this.name; }
private String age;
public void setage(String age)
{ this.age=age; }
public String getage()
{ return this.age; }
private String phone;
public void setphone(String phone)
{ this.phone=phone; }
public String getphone()
{ return this.phone; }
private String email;
public void setemail(String email)
{ this.email=email; }
public String getemail()
{ return this.email; }
private String QQ;
public void setQQ(String QQ)
{ this.QQ=QQ; }
public String getQQ()
{ return this.QQ; }
private String m;
public void setm(String m)
{ this.m=m; }
public String getm()
{ return this.m; }
private String ming;
public void setming(String ming)
{ this.ming=ming; }
public String getming()
{ return this.ming; }
private Object lei;
public void setlei(Object lei)
{ this.lei=lei; }
public Object getlei()
{ return this.lei; }
private boolean x1State;
private boolean x2State;
private boolean x3State;
private boolean x4State;
private boolean x5State;
private boolean x6State;
private boolean xState;
private boolean sState;
private boolean bState;
private boolean tState;
public void setx1State(boolean x1State)
{ this.x1State=x1State; }
public boolean getx1State()
{ return this.x1State; }
public void setx2State(boolean x2State)
{ this.x2State=x2State; }
public boolean getx2State()
{ return this.x2State; }
public void setx3State(boolean x3State)
{ this.x3State=x3State; }
public boolean getx3State()
{ return this.x3State; }
public void setx4State(boolean x4State)
{ this.x4State=x4State; }
public boolean getx4State()
{ return this.x4State; }
public void setx5State(boolean x5State)
{ this.x5State=x5State; }
public boolean getx5State()
{ return this.x5State; }
public void setx6State(boolean x6State)
{ this.x6State=x6State; }
public boolean getx6State()
{ return this.x6State; }
public void setxState(boolean xState)
{ this.xState=xState; }
public boolean getxState()
{ return this.xState; }
public void setsState(boolean sState)
{ this.sState=sState; }
public boolean getsState()
{ return this.sState; }
public void setbState(boolean xState)
{ this.bState=bState; }
public boolean getbState()
{ return this.bState; }
public void settState(boolean tState)
{ this.tState=tState; }
public boolean gettState()
{ return this.tState; }
}
public void setCardInfo(CardInfo1 cardinfo)
{
this.jTextFieldname.setText(cardinfo.getname());
this.jTextFieldphone.setText(cardinfo.getphone());
this.jTextFieldage.setText(cardinfo.getage());
this.jTextFieldemail.setText(cardinfo.getemail());
this.jTextFieldQQ.setText(cardinfo.getQQ());
this.jTextFieldm.setText(cardinfo.getm());
this.jTextAreaMing.setText(cardinfo.getming());
this.jComboBoxlei.setSelectedItem(cardinfo.getlei());//下拉菜单
this.jCheckBoxx1.setSelected(cardinfo.getx1State());
this.jCheckBoxx2.setSelected(cardinfo.getx2State());
this.jCheckBoxx3.setSelected(cardinfo.getx3State());
this.jCheckBoxx4.setSelected(cardinfo.getx4State());
this.jCheckBoxx5.setSelected(cardinfo.getx5State());
this.jCheckBoxx6.setSelected(cardinfo.getx6State());
this.jRadioButtonx.setSelected(cardinfo.getxState());
this.jRadioButtons.setSelected(cardinfo.getsState());
this.jRadioButtonb.setSelected(cardinfo.getbState());
this.jRadioButtont.setSelected(cardinfo.gettState());
}
public CardInfo1 getCardInf1()
{
CardInfo1 cardinfo=new CardInfo1();
cardinfo.setname(this.jTextFieldname.getText());
cardinfo.setage(this.jTextFieldage.getText());
cardinfo.setphone(this.jTextFieldphone.getText());
cardinfo.setemail(this.jTextFieldemail.getText());
cardinfo.setQQ(this.jTextFieldemail.getText());
cardinfo.setm(this.jTextFieldm.getText());
cardinfo.setlei(this.jComboBoxlei.getSelectedItem());
cardinfo.setming(this.jTextAreaMing.getText());
cardinfo.setx1State(this.jCheckBoxx1.isSelected());
cardinfo.setx2State(this.jCheckBoxx2.isSelected());
cardinfo.setx3State(this.jCheckBoxx3.isSelected());
cardinfo.setx4State(this.jCheckBoxx4.isSelected());
cardinfo.setx5State(this.jCheckBoxx5.isSelected());
cardinfo.setx6State(this.jCheckBoxx6.isSelected());
cardinfo.setxState(this.jRadioButtonx.isSelected());
cardinfo.setsState(this.jRadioButtons.isSelected());
cardinfo.setbState(this.jRadioButtonb.isSelected());
cardinfo.settState(this.jRadioButtont.isSelected());
return cardinfo;
}
private void jRadioButton3ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButton3ItemStateChanged
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -