Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shar_img_gif.setVisible(true);
- Thread s1 = new Thread(new Runnable(){
- public void run(){
- try {
- Thread.sleep(1000);
- shar_img_gif.setVisible(false);
- int i = (int)(Math.random()*o.x);
- shar_otv1.setText(o.otv[i]);
- shar_vopros.setText(shar_text.getText()+"?");
- shar_text.setText(null);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- });
- s1.start();
- shar_otv1.setText(o.otv[i]);
- shar_vopros.setText(shar_text.getText()+"?");
- shar_img_gif.setVisible(true);
- Thread timer = new Timer(1000/*Time in millis*/,e->
- {
- Platform.runLater(()->
- {
- shar_img_gif.setVisible(false);
- int i = (int)(Math.random()*o.x);
- shar_otv1.setText(o.otv[i]);
- shar_vopros.setText(shar_text.getText()+"?");
- shar_text.setText(null);
- }/*Runnable*/);
- }/*ActionListener*/);
- timer.setRepeats(false);
- timer.start();
- Platform.runLater(()->
- {
- //Your code there
- });
Add Comment
Please, Sign In to add comment