jScrollPane.setBounds(new Rectangle(22, 49, 534, 347));
jScrollPane.setViewportView(getJTextArea());
}
return jScrollPane;
}
/**
* This method initializes jComboBox
*
* @return javax.swing.JComboBox
*/
private JComboBox getJComboBox() {
if (jComboBox == null) {
jComboBox = new JComboBox();
jComboBox.setBounds(new Rectangle(54, 407, 149, 24));
String[] mycbox={"微笑","大笑","痛苦"};
jComboBox.addItem(mycbox[0]);
jComboBox.addItem(mycbox[1]);
jComboBox.addItem(mycbox[2]);
}
return jComboBox;
}
/**
* This method initializes jTextField
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField() {
if (jTextField == null) {
jTextField = new JTextField();
jTextField.setBounds(new Rectangle(265, 407, 231, 24));
}
return jTextField;
}
/**
* This method initializes jButton
*
* @return javax.swing.JButton
*/
private JButton getJButton() {
if (jButton == null) {
jButton = new JButton();
jButton.setBounds(new Rectangle(505, 407, 70, 24));
jButton.setText("提交");
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
jTextArea.setText(jTextArea.getText()+"\r\n"+"你"+jComboBox.getSelectedItem().toString()+"地说:"+jTextField.getText());
}
});
}
return jButton;
}
/**
* This method initializes jButton1
*
* @return javax.swing.JButton
*/
private JButton getJButton1() {
if (jButton1 == null) {
jButton1 = new JButton();
jButton1.setBounds(new Rectangle(565, 51, 60, 32));
jButton1.setText("清屏");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
jTextArea.setText("留言内容:");
}
});
}
return jButton1;
}
/**
* This method initializes jButton2
*
* @return javax.swing.JButton
*/
private JButton getJButton2() {
if (jButton2 == null) {
jButton2 = new JButton();
jButton2.setBounds(new Rectangle(565, 112, 60, 32));
jButton2.setText("置顶");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
jTextArea.setCaretPosition(0);
}
});
}
return jButton2;
}
/**
* This method initializes jButton3
*
* @return javax.swing.JButton
*/
private JButton getJButton3() {
if (jButton3 == null) {
jButton3 = new JButton();
jButton3.setBounds(new Rectangle(565, 173, 60, 32));
jButton3.setText("至尾");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
jTextArea.setCaretPosition((int)jTextArea.getText().length());
}
});
}
return jButton3;
}
public static void main(String args[]){
new Liuyb();
}
}
JAVA的留言板是怎么实现新留言 , 和回复留言的 。首先要会数据库,做一张留言表,一张回复表,留言表和回复表呈现一对多关系,就是说在回复表里面加一列叫做‘留言编号’,每次添加回复数据的时候,把对应的的留言id写进表里,insert into
回复表 values(回复id,留言id,回复内容、、、)查的时候 select * from 回复表 where 留言id=想查回复的留言的id,希望理解我说的
javaweb项目里的留言回复逻辑帖子java留言回复功能代码的表id所属用户id主题
留言java留言回复功能代码的表id所属帖子id所属用户id内容
推荐阅读
- 无人直播隔天结账,无人直播对账号有影响吗
- gis如何把两个数据拼接,gis如何把两个数据拼接在一起
- 咋样开微信公众号运营助理,公众号开通运营
- 直播中录屏只有声音,直播时录屏没有声音
- mysql卸载了怎么安装 mysql8022卸载
- net4.5安装时发生严重错误,安装net40发生严重错误
- 公众号发表文章励志,适合发公众号的励志文章
- 九游单机游戏免费下载,九游单机游戏破解
- php获取数据提交 php获取post数据