reset password
Author Message
AldoGil
Posts: 19
Posted 21:02 Nov 14, 2018 |

JOptionPane runs in my main method when I place it there, but when I try to paste it in the start method, the programming begins to run but nothing happens. I have no idea what's going on. I've put a System.out print before the JOptionPane to see if it runs that and then gets to the JOptionPane and it does, but then the JOptionPane doesn't pop up afterward.

rgallegos
Posts: 29
Posted 21:13 Nov 14, 2018 |

I was curious so I did some searching : you cannot use JOptionPane which is a swing component from the JavaFX thread. There's a few workarounds though; have your main use the JOptionPane and process whatever data you need first (I don't know how you would pass the data to the application though.. another class maybe?), or use the things we learned about today about text fields with JavaFX. The second option is much more simpler and relevant to what we are studying. 
Good luck.

AldoGil
Posts: 19
Posted 21:27 Nov 14, 2018 |

I saw that post too, but I dont understand why when others have been able to run it.

AldoGil
Posts: 19
Posted 21:53 Nov 14, 2018 |

For whatever reason, it works on windows in the library, just not on my macbook air. The cards program worked though, so I don't know what is going on.

kknaur
Posts: 540
Posted 11:05 Nov 15, 2018 |

I have no problem running it on my windows Machine.  Unfortunately Mac OS likes to block some Java components.  You may need to go into your security settings and change something.  My students in the past have had to do that, but as someone who does not use a Mac, I do not know how to do that. 

Incidentally those of you who use a Mac may find that in future courses, the Mac OS makes it hard to setup some of the software that we use.  You may want to consider getting a cheap windows machine or getting a free copy of Windows 10 from the CS department and either Dual booting your Mac or running a Windows virtual machine. 

As my friend Richard likes to say "Those of you who have chosen a Mac as your development machine, have chosen to do the CS degree on hard mode." ^_^

Last edited by kknaur at 11:05 Nov 15, 2018.