mochatitan
mochatitan
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 11/7/2024 in #java-help
what would relative path be if im building a maven library that will create a txt file and read/writ
How would i tell the library where the path is? would the depencyy folder change based on if its gradle or not? too many things to think about.
4 replies
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 10/28/2024 in #java-help
issue with maven server, cant find anything on it online
No description
57 replies
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 9/23/2024 in #java-help
what does this mean
i made a basic maven project and this happened Source option 7 is no longer supported. Use 8 or later. Target option 7 is no longer supported. Use 8 or later.
4 replies
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 8/15/2024 in #java-help
trying to get an array of every pixel of an image, why is it not working???
File img = new File("daisy.png");
BufferedImage buffImg = new BufferedImage(570, 760, BufferedImage.TYPE_INT_ARGB);
try {
buffImg = ImageIO.read(img);
}
catch (IOException e) { }

int[][] pixelArray = new int[570][760];

pixelArray = get2DPixelArraySlow(buffImg);
File img = new File("daisy.png");
BufferedImage buffImg = new BufferedImage(570, 760, BufferedImage.TYPE_INT_ARGB);
try {
buffImg = ImageIO.read(img);
}
catch (IOException e) { }

int[][] pixelArray = new int[570][760];

pixelArray = get2DPixelArraySlow(buffImg);
public static int[][] get2DPixelArraySlow(BufferedImage sampleImage) {
int width = sampleImage.getWidth();
int height = sampleImage.getHeight();
int[][] result = new int[height][width];

for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
// System.out.println(row);
// System.out.println(col);
result[row][col] = sampleImage.getRGB(col, row);
}
}

return result;
}
public static int[][] get2DPixelArraySlow(BufferedImage sampleImage) {
int width = sampleImage.getWidth();
int height = sampleImage.getHeight();
int[][] result = new int[height][width];

for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
// System.out.println(row);
// System.out.println(col);
result[row][col] = sampleImage.getRGB(col, row);
}
}

return result;
}
when i print pixelArray its just many many 0's. the image file daisy.png is in the same folder as app.java
50 replies
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 8/14/2024 in #java-help
Code saying index out of bounds but it shouldnt be
No description
4 replies
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 7/11/2024 in #java-help
How to connect Java server to node.js?
in simple terms, I am trying to host a website that you upload a .mp4 to, which i want it to be sent to a java server, where the java server then returns a different video. how can i accomplish this? I.E. what build tools and software, and what dependencies help me work with servers
8 replies
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 6/25/2024 in #java-help
how to make airpod like system
How can I go about making a software that can track the direction of hardware? And how would I program the hardware to send it's location to the software?
4 replies
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 4/27/2024 in #java-help
Anybody have experience with connecting a JavaScript game to a java server?
I need help doing it, I'm trying to make a JS Minecraft game multiplayer, but I don't wanna refactor all the code for node js
7 replies
JCHJava Community | Help. Code. Learn.
Created by mochatitan on 4/25/2024 in #java-help
How to make a Java server interact with a JS game
Im making a javascript game, but i want to be able to make it multiplayer. should i make the server using java or node.js? not only do i want to make it online so 2 players are playing together, but i also want the application to save their progress onto files, and idk if node.js can do that.
10 replies