标签: java swing thread-sleep cardlayout
我想显示2个cardlayout,第一个将显示,然后在一段延迟后将显示第二个。我尝试了我的代码,但它将跳过第一个并直接显示第二个。
CardLayout cardLayout = (CardLayout)mainpanel.getLayout(); cardLayout.show(mainpanel, "card10"); TimeUnit.SECONDS.sleep(15); cardLayout.show(mainpanel, "card11");