我在java中有一个小的gui swing应用程序(聊天),我需要多次运行它,每次它应该给我一个GUI聊天窗口,
它第一次运行良好,当我尝试在 IntelliJ 中再次运行相同的应用程序时,它不会再生成 GUI 窗口
任何帮助都非常感谢您提前谢谢
public static void main(String[] args) throws IOException, InterruptedException, SQLException {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("sconfig.xml");
CClient client = (CClient) context.getBean("simpleClient");
client.init();
}
应用环境:
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<!-- value>tcp://localhost:61616</value -->
<value>vm://localhost</value>
</property>
</bean>
<!-- <bean id="pooledJmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
destroy-method="stop">
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>-->
<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="jmsExample" />
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>
<bean id="simpleClient" class="com.CClient">
<property name="template" ref="jmsTemplate"/>
<property name="destination" ref="destination" />
</bean>
<bean id="messageListener" class="com.ExampleListener" />
<!-- and this is the message listener container -->
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="destination" ref="destination"/>
<property name="messageListener" ref="messageListener" />
</bean>