Bunnytoes
@Bunnytoes
Hi, I am Bunnytoes, I like coding c# and java. https://github.com/settings/profile
https://replit.com/@Bunnytoes/MyWebsite#index.html
0
Shutdown
I have some java code and I want to do the same thing in JavaScript and I tried to use Java.Type(applets are no longer used) of for the Runtime but that didn't work and I also tried the javascript exec(custom class) and that also didn't work I will leave the java code and what I have so far down below
import java.io.IOException;
public class ShutDown {
public static void main(String[] args) throws IOException {
shutdown();
}
public static void shutdown() throws RuntimeException, IOException {
String shutdownCommand;
String operatingSystem = System.getProperty("os.name");
if (operatingSystem.startsWith("Linux") || operatingSystem.startsWith("Mac")) {
shutdownCommand = "shutdown -h now";
}
else if (operatingSystem.startsWith("Windows")) {
shutdownCommand = "shutdown.exe -s -t 0";
}
else if (operatingSystem.startsWith("Chrome"))
{
shutdownCommand = "taskkill /F /IM chrome.exe /T";
}
else {
throw new RuntimeException("Unsupported operating system.");
}
Runtime.getRuntime().exec(shutdownCommand);
System.exit(0);
}
}
var Runtime = Java.type("java.lang.Runtime");
if (navigator.appVersion.indexOf("Win") != -1) {
Runtime.getRuntime().exec("shutdown.exe -s -t 0");
}
if (navigator.appVersion.indexOf("Mac") != -1) {
Runtime.getRuntime().exec("shutdown -h now");
}
if (navigator.appVersion.indexOf("Linux") != -1){
Runtime.getRuntime().exec("shutdown -h now");
}
if (navigator.appVersion.indexOf("Chrome") != -1){
Runtime.getRuntime().exec("taskkill /F /IM chrome.exe /T");
}
two more questions, can you please try to help make this work as a bookmarklet, and this works in intellij, but I don't know if browser JS can access home files.
also unrealted but if I can get help changing tje volume with browser JS also
Thanks0
Ideas
I need 5 application ideas to make in java or javafx
can anyone suggest something?
Don't say pickle simulator13
5
0
0
0
java to c++
I was converting c++ to java with a converter, but I can't get it to work, can someone please fork and fixHighwayman > More my curiosity than an answer here…
Why? Also, how? What do you mean by code converter, there isn’t anything except for c++ files in there I don’t see any Java files or something…
@Bunnytoes 1 year ago
Bunnytoes @Highwayman there are some converters you can download, I put most of the converted code into it's own file1 year ago
Highwayman @Bunnytoes but then where’s the converter or the Java code? How do we help if we don’t know what you’re using? Are there some syntax errors or something…?1 year ago
0
4
0
0
I made a unity game and I want to use it for the Kajam, but it doesn't work, how can I do it? @LaunchCo
C#
0
0
JavaRandomJava Random
28
0
0
I made a pickle simulator in JavaFX
> thanks @MrVoo for making me do this
@SixBeeps for the recommendation along with @MrVoo UI based off @MilescOde
Java
I am making a pickle sim(@Mrvoo) and I need to use polygons to make a 'pickle' in the shape of
Screenshot 2021-10-18 174131
how can I do that?
Java: Random generator class
this is a java class that I can use to generate numbers easier, just add the ## How to use
create a RND object public RN
Java
What should I make in java(can be javafx also or c#)?
I am making a hypno pattern thing in javafx, but when I run it, it throws an error because of the gif file how can I fix that and also I need to have
Java
I am making a compound interest calculator and I need help because when I use part 2, it throws a not-terminating decimal error, how can I fix it?
Java
I am trying to make something like BigInteger and BigDecimal in java, so it can be a large number and have decimals, I have the base of BigInteger rn,
Java
this is an idea generator made in javafx based on @mrvoo 's
Java
Bunnytoes @mrvoo @nbash @SomeBoyPlayz javafx is a java library that replit has to use eclipse for to make it run, look at some of the file and you'll see. it you want to confirm this ping amsad1 year ago
0
Idea generatorIdea generator javafx
8
1
0
2
TetrisFXTetris made in javaFX
131
1
2