Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
notem with java
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Marcofras
n00b
n00b


Joined: 29 May 2023
Posts: 14

PostPosted: Tue Nov 12, 2024 4:11 pm    Post subject: notem with java Reply with quote

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
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2425

PostPosted: Tue Nov 12, 2024 4:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
keekkenen
n00b
n00b


Joined: 05 Oct 2024
Posts: 5

PostPosted: Tue Nov 12, 2024 5:58 pm    Post subject: Re: notem with java Reply with quote

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
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31268
Location: here

PostPosted: Tue Nov 12, 2024 6:22 pm    Post subject: Reply with quote

You can find many example step by step on web.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Marcofras
n00b
n00b


Joined: 29 May 2023
Posts: 14

PostPosted: Fri Nov 15, 2024 4:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum