|
I know this sounds weird to say in 2014, but are Java applets dead? I have a very simple JavaFX application. Small time, academic stuff. I'd like to place a weblaunch/jnlp link on my blog so that my professors can open it. Unfortunately java security always shuts down the application. Basically since java7u51 all web applets, even when running on sandbox mode, need to be signed. And not just self-signed, but signed by a certificate authority. That's not the kind of thing a graduate student like me can afford. Does that mean that only businesses that can afford it now are allowed to use applet/weblaunch? That's so incredibly frustrating.
|
# ¿ Apr 15, 2014 22:55 |
|
|
# ¿ Apr 27, 2024 21:40 |
|
rhag posted:By default that is true, self-signed applets won't run anymore. But, if your users are willing, they can tell java that they trust site http://yourblog.com and then they will be able to run your self signed java application from jnlp. Yeah, that's true. But it's very much of a drag. I wouldn't bother with it if I stumbled upon my blog. Which is sad, really.
|
# ¿ Apr 16, 2014 05:03 |
|
Hope this is the right thread to ask this. So I code agent-based models. Which you can just imagine being complicated 2d games. I code them in Java I like structured object oriented programming. My issue is with deployment. I want other people to use my models. To "play" my games. Few years ago all I had to do was to place a java applet somewhere and people could just use my model straight from a web-page. Now applets only work if I pay hundreds of dollars to Verisign to sign them. I'd like another way to code the gui so that anybody can use my model just by connecting to a web-page hosting it. The GUI can be any language. I am willing to learn. The "backend" model has to stay Java though. I am really confused. Is there any technology that allows this? Mind you: these aren't web-apps. There is no server/communication involved. You download your 10mb model and you are good to go. Suggestions on the tech to use to code the gui?
|
# ¿ Sep 2, 2014 11:37 |
|
quote:With newer version of the JRE installed, they had to specifically say they trust the server in the Control Panel applet It's a pain. They'll just go somewhere else. quote:If you're ok with people downloading the app, why not just make a jar, or whatever the new-fangled web-start stuff is called nowadays? Download and run is my current modus operandi, but i really wish they could just run from the web. quote:If you wanna change the UI, in HTML 5 you can do quite nifty things with WebGL and java script: https://www.unrealengine.com/html5 .
|
# ¿ Sep 2, 2014 19:20 |
|
I'd imagine that killing all sorts of reactivity, right? Is there a code example of a java-backed html5 2d game?
|
# ¿ Sep 2, 2014 20:07 |
|
First of all, thank you for all the answers.quote:Is your audience likely to even have the JRE installed and enabled? I mean I'm someone who codes in Java and if I see a webpage trying to run a Java applet, I usually say 'gently caress this poo poo' and hit that back button. Not saying I'm a representative sample or anything, and you know your audience, but if you're looking for ease of use I'd imagine you want something that just runs 'natively' in the browser Okay, to clarify what I need. Imagine a very, very lovely sim-city. Take model-view-controller abstraction. The model is the citizens, the markets, the rules of trading, the geography. All that stuff. It has to be in Java. This is because the end goal of these models is peer-review. And since others in my field code in Java, I need to do the same. I show up with go or dart and people just don't know what they are looking at. The view and the controller, I'd like to be native in the browser. This makes for much easier prototyping and I can let my audience play with the model before it is complete and before they need to plunge into the source code. I can code this in any language i see fit. Peers don't care. Now, what I don't understand is, if I learn HTML5 or Javascript or whatever do I need to implement a server-client interaction? If so, what machine is actually running the model (the city simulation)? That's what I liked about applets. It would just work out of the box.
|
# ¿ Sep 3, 2014 05:28 |
|
Gul Banana posted:In general there's no way to do general-purpose execution on the web client. Only specific exemptions exist: chrome's nacl, java applets before the security problems, flash until it dies... Unless you can fit into one of those holes, it's javascript only. Got it, thanks!
|
# ¿ Sep 3, 2014 22:17 |
|
evilentity posted:If you want to do the codes in java for 2d game, and make it run in modern browser, use libgdx. With very little work you can compile it js and run in a browser. No need to implement client-server stuff. But you would need to rewrite a bunch of stuff, mostly the rendering/gui. Heres an old demo of my android game running in a browser, no plugins or anything required That looks really cool. Let me take a look. You were very kind. Thanks.
|
# ¿ Sep 17, 2014 14:31 |
|
I want to know, is google GWT kind of like libgdx? Libgdx is cool, great. I like the easy life-cycle. But I need boring ui. With buttons and charts. Kind of like the GWT widgets! But is gwt just a client gui with the java part running on a server? Or is it like libgdx where the whole java is magically turned into javascript and run in browser?
|
# ¿ Sep 18, 2014 15:17 |
|
evilentity posted:You can make boring gui in libgdx just fine. spine 2d is made in libgdx. That looks fantastic. But it is proprietary. Is there anything similar that is open-source enough for me to peek?
|
# ¿ Sep 19, 2014 00:15 |
|
quote:My problem is that this loop never finishes even if the button is clicked (a print statement in the actionListener shows it works) and start is set to true unless I either print something to the terminal or use Thread.sleep(1) (or any number) within the while loop But i am curious, what happens in the //wait part?
|
# ¿ Sep 19, 2014 09:47 |
|
Loezi posted:Unless you have been outright told to save the balance as a double stop right here and convert to int of cents (or local variant). Doubles are unable to represent all the required values and you'll sooner or later run into bugs with account balances like 100.00000001 and two "same" balances being not equal to each other. BigDecimal could help but it's cumbersome, Java 9 should come with a money API too.
|
# ¿ Dec 8, 2014 14:19 |
|
And I imagine adding and subtracting monetary values will be the most painful experience in the universe (see big decimals). After trying my hand coding Dart I miss simple operator overload in Java.
|
# ¿ Dec 9, 2014 03:59 |
|
quote:I can see that, but I've recently poked my head into Scala, and it is not fun trying to figure out what in the hell the ::% operator is supposed to signify when reading someone else's code. Dart pairs it down to the usuals +,-,[],>, you know, what you'd call an operator. Now, I personally like Java's verbosity a lot. Except when dealing with things where the operator is obvious. If I have to do something like this: Big Decimal("5.1").plus(new BigDecimal(".23")).multiplyBy(new BigDecimal(".11")); I am wasting my time. CarrKnight fucked around with this message at 09:52 on Dec 9, 2014 |
# ¿ Dec 9, 2014 09:49 |
|
On the topic, does anybody here unit tests swing? I'd like to know what program you use, but also how to structure gui unit tests (i find it so hard to isolate the gui)
|
# ¿ Apr 25, 2015 04:49 |
|
quote:so you're likely to end up spending a lot of time rewriting the tests. quote:Try to get as much of your logic out of the GUI as you can (ideally everything not specific to the construction and arrangement of your Swing components
|
# ¿ Apr 26, 2015 17:36 |
|
JimboMaloi posted:That's super unfortunate. Are you ending up with a bunch anonymous SwingWorkers inside your Swing classes? Are you running your business logic on the EDT? I am not running the business logic on the EDT, but that might be maybe the only good thing I can say about the libraries I use.
|
# ¿ Apr 28, 2015 04:22 |
|
So this is a general question, but I am implementing it in Java so here it is. I have a somewhat hierarchical structure in my code, something like this: code:
code:
code:
My current approach is to use Map<String,Factory<Strategy1>> or whatever, but I am not sure that's the best way to go about it.
|
# ¿ May 10, 2015 17:19 |
|
Jabor posted:It looks a lot like you're trying to solve the Dependency Injection problem. I'd recommend taking a look at some of the mature DI frameworks around and seeing if any of them is suitable for your needs. Yes! I think so. I only encountered the definition of DI in testing books but it's correct. Now my main problem is that I work with a team of academicians and to be honest I can't expect them to go through Guice or Spring. I had a small lecture on what @Nullable and @NonNull mean and if I start adding more weird stuff I make the code illegible for anyone but me. Is there a framework that is easily readable? Need to look at Jackson I guess.
|
# ¿ May 10, 2015 17:55 |
|
Awesome. Is there a name for this kind of pattern? That's pretty much what I do except I make it into a separate factory class, well really Function<Json,Strategy> since I might need to modify the parameters through GUI after they are read but before the strategies are created.
|
# ¿ May 10, 2015 22:57 |
|
So I really need a place and method to store large amounts of transient and temporary data. Best summary I can give, imagine a videogame like Sims. Each sim does stuff and it creates a record of everything it does. While it was still a simple game I just stored every record in a LinkedList. Each Sim had its own LinkedList with its own records in it. Sometimes the sim needs to take these records and analyze them and sometimes I need them for debugging. Now, it worked when everything was simple and quiet but now there are gazillions of records being created and they quickly overwhelm the memory so I need some framework/idea on how to store this information on disk in a way that makes sense and it's easy to retrieve while the game is running but there is no need for permanence (no saved games or anything like that) Is SQL still the way to go?
|
# ¿ Jul 1, 2015 19:57 |
|
|
# ¿ Apr 27, 2024 21:40 |
|
JCommander is another library that helps with main arguments. This is an example of how to code the help case.
|
# ¿ Jul 9, 2016 23:37 |