Invisible applet

  • Thread starter Dirk Bruere at NeoPax
  • Start date
D

Dirk Bruere at NeoPax

A

Arne Vajhøj

Dirk said:
Using netbeans designer to put together a JApplet - Form holding a
Jpanel with stuff on it. Sometimes it compiles OK and the applet looks
fine in an HTML page. Other times I just end up with a blank applet (no
error messages).

No error messages in Java Console ?

Arne
 
A

Andrew Thompson

Using netbeans designer to put together a JApplet - Form holding a
Jpanel
JPanel?

.. with stuff on it. Sometimes it compiles OK ..

So other times it does not compile OK?
..and the applet looks
fine in an HTML page. Other times I just end up with a blank applet (no
error messages).

Dose the code at any stage call setLayout(null)?

Does the code call validate() after all components
are added?
Always runs OK in the applet viewer in Netbeans.
What am I doing wrong?

1) Relying on anything Netbeans does during development,
as being an accurate reflection of the 'real world'.
2) Relying on the applet viewer (which I suspect, NB invokes
to display applets) as being realistic of behavior in a JRE
in a web page.
 
D

Dirk Bruere at NeoPax

Andrew said:
So other times it does not compile OK?

Usually after I resize the JPanel on the form
Dose the code at any stage call setLayout(null)?

It did at one time.
Does the code call validate() after all components
are added?


1) Relying on anything Netbeans does during development,
as being an accurate reflection of the 'real world'.
2) Relying on the applet viewer (which I suspect, NB invokes
to display applets) as being realistic of behavior in a JRE
in a web page.

Shit - now the design view won't close.
Are you going to tell me Netbeans is a heap of crap?

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
A

Andrew Thompson

Usually after I resize the JPanel on the form

(polite cough)
1) That sound more like a run-time fix.
2) Don't even start to think about 'resizing'
anything embedded within an applet. That is
a 'recipe for disaster'.
It did at one time.

Are you saying that it no longer calls it, or
only calls it once in the code?

Am expecting an answer to this question. That is
why I asked it.

(please trim sigs)
Shit - now the design view won't close.
Are you going to tell me Netbeans is a heap of crap?

No. Netbeans is a fine IDE. It is just that you
should not come to rely too heavily on the way
Netbeans does things, since you need to deploy the
project in the real world, or perhaps even over the
world 'wild' web (an even tougher deployment environment
than many others).

The major problem in this case, is probably the
Applet Viewer, which although it tries hard, does
not accurately reflect the browser environment.

As a result of its deficiencies I wrote and offer
Appleteer*, which goes a little further in representing
an actual applet deployment (e.g. allows multiple
applets in same page, stream sharing, showDocument() ..),
though still falls far short in many significant areas
(security, JS support, ..applet resizing).

* <http://pscode.org/appleteer/>
 
D

Dirk Bruere at NeoPax

Andrew said:
(polite cough)
1) That sound more like a run-time fix.
2) Don't even start to think about 'resizing'
anything embedded within an applet. That is
a 'recipe for disaster'.

No - I meant during the design stage, not when running it.
Are you saying that it no longer calls it, or
only calls it once in the code?

I have no idea - where do I find that info in the IDE?
Am expecting an answer to this question. That is
why I asked it.

Where do I look?
Where does Netbeans hide all the source?
(please trim sigs)


No. Netbeans is a fine IDE. It is just that you
should not come to rely too heavily on the way
Netbeans does things, since you need to deploy the
project in the real world, or perhaps even over the
world 'wild' web (an even tougher deployment environment
than many others).

Well, so far I'm only deploying it to my PC. Specifically, Firefox.
The major problem in this case, is probably the
Applet Viewer, which although it tries hard, does
not accurately reflect the browser environment.

Obviously true.
As a result of its deficiencies I wrote and offer
Appleteer*, which goes a little further in representing
an actual applet deployment (e.g. allows multiple
applets in same page, stream sharing, showDocument() ..),
though still falls far short in many significant areas
(security, JS support, ..applet resizing).

* <http://pscode.org/appleteer/>

Thanks - I'll take a look


Dirk
 
D

Dirk Bruere at NeoPax

Dirk said:
No - I meant during the design stage, not when running it.


I have no idea - where do I find that info in the IDE?


Where do I look?
Where does Netbeans hide all the source?


Well, so far I'm only deploying it to my PC. Specifically, Firefox.


Obviously true.


Thanks - I'll take a look

Well, it won't even run the applet that looks ok in the browser.
I don't have a clue as to where to start debugging this stuff.

Dirk
 
A

Andrew Thompson

...
No - I meant during the design stage, not when running it.

Huhh*. My bad.
I have no idea - where do I find that info in the IDE?



Where do I look?
Where does Netbeans hide all the source?

I have no idea. * Note that I neither use, nor provide
support for, Netbeans. Each IDE has its own support
forums or mailing lists.
Well, so far I'm only deploying it to my PC. Specifically, Firefox.

OK, but note that applets embedded in a browser
really only make sense when they are deployed to
a large audience over the internet and/or require
interaction with JS. For deploying most other
rich client projects (and some intended for a wide
audience) from the internet, webstart makes more
sense.
 
J

John B. Matthews

Dirk Bruere at NeoPax said:
Where does Netbeans hide all the source?

In an editor-fold. Click on the Source button in the tool bar. Look for
the phrase "Generated Code". Click on the "+" in the left margin. Voila!
 
D

Dirk Bruere at NeoPax

Andrew said:
Huhh*. My bad.


I have no idea. * Note that I neither use, nor provide
support for, Netbeans. Each IDE has its own support
forums or mailing lists.

I've just signed up to the Netbeans forum
OK, but note that applets embedded in a browser
really only make sense when they are deployed to
a large audience over the internet and/or require
interaction with JS. For deploying most other
rich client projects (and some intended for a wide
audience) from the internet, webstart makes more
sense.

Well, it's designed for a rather limited audience on an intranet.
Anyway, I'm off to bed now - it's 3:00am here.

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
M

Mark Space

Dirk said:
Where do I look?
Where does Netbeans hide all the source?

Hmm, this does not bode well. Do you have much experience with Java?
The source tree in NetBeans matches exactly what Sun recommends for
command line style projects. Look in the "src" directory under your
project name.

There's also a list of files, by project, in the tab next to the
Projects tab. It's labeled "Files".

There's also a button labeled "Source" on the GUI designer, just in case
you missed that too. It's on the far left, on the top menu bar, just
below where the tabs are representing your different files.

You really ought to take some time to learn an IDE before you use it.
All this stuff can be found on the various tutorials on the NetBeans web
page. The GUI designer (called Matisse, actually) tutorial tells you
how to modify the source code after you've used drag-and-drop mode.
It's very explicit and informative.
 
J

John B. Matthews

Lew <[email protected]> said:
Dirk Bruere at NeoPax wrote: [...]
In a .java file in a directory that corresponds to the package name,
typically in a subdirectory of a 'src/' subdirectory of the project
directory.

The name of the .java file corresponds to the class name.

D'oh. I was tinkering with the editor fold, but any editor can show the
folded text. Interestingly, one can use the fold feature to hide any old
boiler-cruft by default:

// <editor-fold defaultstate="collapsed" desc="ReadMe">
/* @2009 Yoyodyne, all rights reserved... */
// </editor-fold>
 
D

Dirk Bruere at NeoPax

Mark said:
Hmm, this does not bode well. Do you have much experience with Java?

I did a bit 10 years ago and have currently being doing it with Netbeans
for around 4 weeks.
The source tree in NetBeans matches exactly what Sun recommends for
command line style projects. Look in the "src" directory under your
project name.

There's also a list of files, by project, in the tab next to the
Projects tab. It's labeled "Files".

There's also a button labeled "Source" on the GUI designer, just in case
you missed that too. It's on the far left, on the top menu bar, just
below where the tabs are representing your different files.

You really ought to take some time to learn an IDE before you use it.
All this stuff can be found on the various tutorials on the NetBeans web
page. The GUI designer (called Matisse, actually) tutorial tells you
how to modify the source code after you've used drag-and-drop mode. It's
very explicit and informative.

Thanks, I'll look it up.
As usual however, it's pressure for results that is driving this project.
That's why some of my posts to this NG are at 03:00 local time. Of
course, I do start work late after getting up ie around 11:00 :-(
Isn't working from home great.

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
D

Dirk Bruere at NeoPax

M

Mark Space

Dirk said:
Thanks, I'll look it up.
As usual however, it's pressure for results that is driving this project.
That's why some of my posts to this NG are at 03:00 local time. Of
course, I do start work late after getting up ie around 11:00 :-(


Well, you really ought to set some time aside. Staying up until 3 am
isn't helping if you're just spinning your wheels. I'd set some time
aside each day, at least 1 hour, and do nothing except try to learn some
tool or feature that's been giving you trouble. Those tutorials I
mentioned are well worth it if you're just starting out.

I have personal limits, time wise, even when working from home. I'm no
good past 12 pm, so I go to bed then no matter what. Sleep is more
effective use of my time then instead of doing nothing but staring
blearily at a monitor. If I need to I can get up at 6 or 7 am and start
in working again. I'm much more alert, fresher and I've had a night
sleep to let my brain cogitate on any issues. You'd be surprised how
many problems can be solved by sleeping on them.
 
D

Dirk Bruere at NeoPax

Mark said:
Well, you really ought to set some time aside. Staying up until 3 am
isn't helping if you're just spinning your wheels. I'd set some time
aside each day, at least 1 hour, and do nothing except try to learn some
tool or feature that's been giving you trouble. Those tutorials I
mentioned are well worth it if you're just starting out.

I have personal limits, time wise, even when working from home. I'm no
good past 12 pm, so I go to bed then no matter what. Sleep is more
effective use of my time then instead of doing nothing but staring
blearily at a monitor. If I need to I can get up at 6 or 7 am and start
in working again. I'm much more alert, fresher and I've had a night
sleep to let my brain cogitate on any issues. You'd be surprised how
many problems can be solved by sleeping on them.

True, but fortunately I rather like working at night.
I'm pretty useless for the first few hours after getting up.

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Can an Applet beep? 4
Free keyboard applet 5
Netbeans oddity 1
Official Java Classes 10
Accessing static field 21
Java in Java 10
Simple Netbeans problem 1
ListModel name 10

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top