Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Trying to run applet

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have just learned that applets are different animals.

They don't need a main class to run.
Or at least that is what I was told.

So I try to run an applet and up pops an error message saying:

Project does not have a main class set!

So my questions are:

1. Does a java applet require a main class?
2. If so how do I set one so my applet will run?
3. Why does the fellow in the video not have a main class set in his code, yet his applet runs?

TIA

It may be useful to know that when I cleaned and built the applet it was successful and built a .jar.
But it won't run.

 
Marshal
Posts: 25594
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. No, it doesn't.

2. You don't set one because that's not how an applet works.

3. See 2.

That may seem kind of terse and dismissive. But I'm here to advise you not to waste your time on applets, that's why I'm not expanding on those answers. They are a technology which is, if not quite dead, a niche technology. You aren't going to find a use for applets, and if you do happen to find one then you'll find yourself in a tar pit of security features. So you'd be better off looking elsewhere for things to learn about Java.
 
David Henstridge
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:1. No, it doesn't.

2. You don't set one because that's not how an applet works.

3. See 2.

That may seem kind of terse and dismissive. But I'm here to advise you not to waste your time on applets, that's why I'm not expanding on those answers. They are a technology which is, if not quite dead, a niche technology. You aren't going to find a use for applets, and if you do happen to find one then you'll find yourself in a tar pit of security features. So you'd be better off looking elsewhere for things to learn about Java.



OK thanks Paul. All this is new to me, but I will certainly take your word for it and move on from applets.
I was investigating key actions and this video was showing how to use the dreaded keytype/keypress events that you also don't take kindly to.

So onward and upward.

I have created a Frame (not using applets) a panel and a button.
Now my goal is to not only find out how to use the keyboard to execute the button code,
but to find out how my main program that I am studying uses their own, different code,
to access events with keystrokes (possibly key events).




 
Paul Clapham
Marshal
Posts: 25594
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Video tutorials -- another thing I don't care for. If you miss something near the beginning (as it looks like you might have done) it's hard to look back and find it. Harder than a page of text, at least for somebody like me who is used to scanning pages of text to extract information.
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic