View previous topic :: View next topic |
Author |
Message |
Marcofras n00b
Joined: 29 May 2023 Posts: 14
|
Posted: Tue Nov 12, 2024 4:11 pm Post subject: notem with java |
|
|
im trying to make a note app for android with java and i try tomake the main window with
Code: |
import javax.swing.JFrame;
public class EmptyFrame {
public static void main(String[] args) {
JFrame jFrame = new JFrame("Empty window");
jFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
jFrame.setSize(400,400);
jFrame.setVisible(true);
}
}
|
and compile with
Code: |
m@localhost ~/Desktop/notem $ java EmptyFrame.class
Error: Could not find or load main class EmptyFrame.class
Caused by: java.lang.ClassNotFoundException: EmptyFrame.class
|
|
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2425
|
Posted: Tue Nov 12, 2024 4:24 pm Post subject: |
|
|
You should run the class, not the class file. In Java there's no concept of executable files. They are not self contained, they need the JVM to execute them.
Code: | m@localhost ~/Desktop/notem $ java EmptyFrame |
Best Regards,
Georgi |
|
Back to top |
|
|
keekkenen n00b
Joined: 05 Oct 2024 Posts: 5
|
Posted: Tue Nov 12, 2024 5:58 pm Post subject: Re: notem with java |
|
|
Marcofras wrote: | im trying to make a note app for android with java and i try tomake the main window with |
Are you sure of it?
Android uses its own API for making window views in application.
Swing is a part of Java Core and used for making desktop applications. _________________ 7950x3d / x670e MSI Tomagawk / Sapphire RX 7800XT 16Gb / G.Skill 64Gb 5600 / A-Data Legend 960 2Tb (x2), A-Data SX8200PNP 256Gb |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31268 Location: here
|
|
Back to top |
|
|
Marcofras n00b
Joined: 29 May 2023 Posts: 14
|
Posted: Fri Nov 15, 2024 4:04 pm Post subject: |
|
|
done it works on desktop but not works in android device because is not capable to open a file java.
is there a possibility to have a note app on my android 2.3.6?
make from scratch with no ide?
alternative repository for download the app?
im searching on the web |
|
Back to top |
|
|
|