📄 user1.java
字号:
.addComponent(jScrollPane1, 0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(word, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(19, 19, 19)
.addComponent(jButton4)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3))
.addComponent(jLabel1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(panel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)))
.addContainerGap(10, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton4)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(word, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(add)
.addGap(13, 13, 13)
.addComponent(open)
.addGap(16, 16, 16) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(wordc, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(19, 19, 19)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton3)
.addComponent(jButton1)))
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE))
.addContainerGap())
);
}
public JTextArea getwordList(){
return wordlist;
}
public JTextArea getwordexplan(){
return explain;
}
public JLabel getpanel(){
return jPanel1;
}
public JLabel getpane(){
return jLabel4;
}
public void actionPerformed(ActionEvent e) {
if(wordc.getSelectedIndex()==1){
wordc.setSelectedIndex(0);
explain.setText("");
st.Successfulinserchtype("n");
}
if(wordc.getSelectedIndex()==2){
wordc.setSelectedIndex(0);
explain.setText("");
st.Successfulinserchtype("vt"); }
if(wordc.getSelectedIndex()==3){
explain.setText("");
st.Successfulinserchtype("vi");
wordc.setSelectedIndex(0);
}
if(wordc.getSelectedIndex()==4){
explain.setText("");
st.Successfulinserchtype("a");
wordc.setSelectedIndex(0);
}
if(wordc.getSelectedIndex()==5){
explain.setText("");
st.Successfulinserchtype("ad");
wordc.setSelectedIndex(0);
}
if(wordc.getSelectedIndex()==6){
explain.setText("");
st.Successfulinserchtype("prep");
wordc.setSelectedIndex(0);
}
if(wordc.getSelectedIndex()==7){
explain.setText("");
st.Successfulinserchtype("pron");
wordc.setSelectedIndex(0);
}
if(wordc.getSelectedIndex()==8){
explain.setText("");
st.SuccessfulInserch_oneword("conj");
wordc.setSelectedIndex(0);
}
if(wordc.getSelectedIndex()==9){
explain.setText("");
st.SuccessfulInserch_oneword("num");
wordc.setSelectedIndex(0);
}
if(wordc.getSelectedIndex()==10){
explain.setText("");
st.SuccessfulInserch_oneword("inter");
wordc.setSelectedIndex(0);
}
if(e.getSource()==jButton1){
st.getVector().removeAllElements();
st.getselect().setVisible(true);
this.setVisible(false);
wordlist.setText("");
explain.setText("");
}
if(e.getSource()==jButton3){
System.exit(0);
}
if(e.getSource()==jButton2){
// System.out.println(st.GetType());
if(st.GetType() != 1 ){
st.getPassword().setVisible(true);
}
else{
JOptionPane.showMessageDialog(this,"对不起,匿名用户无此权限");
}
}
if(e.getSource() == jButton4){
st.Successful_wordname(word.getText().trim(),1);
}
if(e.getSource() == open){
if(st.GetType() == 1){
JOptionPane.showMessageDialog(this,"你没有此权限");
}else{
st.SentMessage("119"+st.getusername()+" ");
//st.getnewword().setVisible(true);
}
}
if(e.getSource() == add){
if(st.GetType() == 1){
JOptionPane.showMessageDialog(this,"你没有此权限");
}
else{
st.Successful_wordname(word.getText().trim(),2);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -