我正在ActiveMQ项目中积极使用。尽管生产使用独立ActiveMQ实例,但我的测试需要嵌入式ActiveMQ实例。执行特定的测试方法后,ActiveMQ将未处理的消息保留在队列中。我想ActiveMQ在每次测试后清除实例。我试图用来JMX连接本地ActiveMQ实例并清除队列,但这是重量级的解决方案。谁能建议我一些更轻巧的东西?
为什么这是不同的:
select from_unixtime(1383699655)我得到了'2013-11-06 09:00:55',但当我转换1383699655时
java.util.Date,new Date(1383699655),我得到了 Sat Jan 17 08:21:43 CST 1970
添加一行后,我希望刷新JTable.不幸的是它不是.
我的代码是这样的:
我如何添加一行:
JButton btnDodaj = new JButton("Dodaj");`
panel.add(btnDodaj);
btnDodaj.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int selectedOption = JOptionPane.showConfirmDialog(null, "Na pewno chcesz dodac nowy rekord?",
"wybieraj", JOptionPane.YES_NO_OPTION);
if (selectedOption == JOptionPane.NO_OPTION) {
return;
}
dbHelper.dodajOsoba(editPaneName.getText(), editPaneNazw.getText(), formattedDataUr.getText(),
(Enum) comboBoxStCyw.getSelectedItem(), (String) comboBoxZaw.getSelectedItem(),
(String) comboBoxMia.getSelectedItem(), textFieldPesel.getText());
simpleTableDemo.model.fireTableDataChanged();
}
});
Run Code Online (Sandbox Code Playgroud)
我如何将simpleTableDemo添加到JPanel:
simpleTableDemo = new ListaOsob();
sl_panel.putConstraint(SpringLayout.NORTH, simpleTableDemo, 100, SpringLayout.SOUTH, comboBoxMia);
sl_panel.putConstraint(SpringLayout.WEST, simpleTableDemo, 33, SpringLayout.WEST, panel);
sl_panel.putConstraint(SpringLayout.EAST, simpleTableDemo, 617, SpringLayout.WEST, panel);
panel.add(simpleTableDemo);
Run Code Online (Sandbox Code Playgroud)
SimpleTableDemo的定义:
Object[][] data2 = dbHelper.wyswietlOsoba();
model = new DefaultTableModel(data2, columnNames); …Run Code Online (Sandbox Code Playgroud)