473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Applets

Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet?

I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file
Jul 17 '05 #1
9 5235
"Andy" <an************@yahoo.co.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet? Yes
I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file


Not likely. You have a code problem. Find an error message to share. If
you're running a fairly recent JRE, you should have Web Start, which gives
you a console, where you'll find your stdout stuff (including stack traces).
Jul 17 '05 #2
"Andy" <an************@yahoo.co.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet? Yes
I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file


Not likely. You have a code problem. Find an error message to share. If
you're running a fairly recent JRE, you should have Web Start, which gives
you a console, where you'll find your stdout stuff (including stack traces).
Jul 17 '05 #3

"Andy" <an************@yahoo.co.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet?

I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file


Yes,

Applets are not allowed to do things like read files, do networking stuff to
other servers thanm the one that served the page they are on, accessing
ports etc. In short, in general an application will not run as an applet.
There are ways to grant applets all kinds of priviliges but that would at
least involve signing it (and buying an expensive certificate from Verisign
and the likes).

Silvio Bierman
Jul 17 '05 #4

"Andy" <an************@yahoo.co.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet?

I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file


Yes,

Applets are not allowed to do things like read files, do networking stuff to
other servers thanm the one that served the page they are on, accessing
ports etc. In short, in general an application will not run as an applet.
There are ways to grant applets all kinds of priviliges but that would at
least involve signing it (and buying an expensive certificate from Verisign
and the likes).

Silvio Bierman
Jul 17 '05 #5
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message news:<H5********************@texas.net>...
"Andy" <an************@yahoo.co.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet?

Yes
I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file


Not likely. You have a code problem. Find an error message to share. If
you're running a fairly recent JRE, you should have Web Start, which gives
you a console, where you'll find your stdout stuff (including stack traces).

hi all
My que is related to J2ME. I am trying to show the loading screen
on a handset by filling of Gauge bars one by one.but ut doesnt worked
so. what it does that it just wait for some secs (coz of
Thresd.sleep()) and then fill all the bars simultaneously..here is the
code of program

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MyGauge extends MIDlet implements CommandListener {
Display display;
int i=0;
Command start=new Command("Start",Command.SCREEN,1);
Form frm=new Form("");
Gauge gauge = new Gauge ("Loading... Please wait.",false,7,0);
public MyGauge() {
display = Display.getDisplay(this);
frm.addCommand(start);
frm.append(gauge);
display.setCurrent(frm);
frm.setCommandListener(this);
}
public void startApp() {
display.setCurrent(frm);
}
public void destroyApp(boolean unconditional) {
}
public void pauseApp() {
}
public void commandAction(Command c,Displayable d) {
try {

for (int j=0;j<=7;j++) {
gauge.setValue(j);
Thread.sleep(1000);
}
}
catch(InterruptedException ie){
}
}
}

I am using J2ME Wireless Toolkit 1.0.4 with KToolbar.All solutions
will be welomed.
pink
Jul 17 '05 #6
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message news:<H5********************@texas.net>...
"Andy" <an************@yahoo.co.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet?

Yes
I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file


Not likely. You have a code problem. Find an error message to share. If
you're running a fairly recent JRE, you should have Web Start, which gives
you a console, where you'll find your stdout stuff (including stack traces).

hi all
My que is related to J2ME. I am trying to show the loading screen
on a handset by filling of Gauge bars one by one.but ut doesnt worked
so. what it does that it just wait for some secs (coz of
Thresd.sleep()) and then fill all the bars simultaneously..here is the
code of program

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MyGauge extends MIDlet implements CommandListener {
Display display;
int i=0;
Command start=new Command("Start",Command.SCREEN,1);
Form frm=new Form("");
Gauge gauge = new Gauge ("Loading... Please wait.",false,7,0);
public MyGauge() {
display = Display.getDisplay(this);
frm.addCommand(start);
frm.append(gauge);
display.setCurrent(frm);
frm.setCommandListener(this);
}
public void startApp() {
display.setCurrent(frm);
}
public void destroyApp(boolean unconditional) {
}
public void pauseApp() {
}
public void commandAction(Command c,Displayable d) {
try {

for (int j=0;j<=7;j++) {
gauge.setValue(j);
Thread.sleep(1000);
}
}
catch(InterruptedException ie){
}
}
}

I am using J2ME Wireless Toolkit 1.0.4 with KToolbar.All solutions
will be welomed.
pink
Jul 17 '05 #7
"Silvio Bierman" <sb******@idfix.nl> wrote in message news:<40*********************@news.xs4all.nl>...
"Andy" <an************@yahoo.co.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet?

I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file


Yes,

Applets are not allowed to do things like read files, do networking stuff to
other servers thanm the one that served the page they are on, accessing
ports etc. In short, in general an application will not run as an applet.
There are ways to grant applets all kinds of priviliges but that would at
least involve signing it (and buying an expensive certificate from Verisign
and the likes).

Silvio Bierman


Hi Steve,

Thanks. Is the best solution therefore to attempt to plug into the
server my applet is on using the URLConnetion class to read an html
file (would that even be allowed). I'm trying to put the applet in
some space I've got from geocities. Do you just change the file from
..txt to .html or is it a bit more complicated than that. :-@

Andy Chambers
Jul 17 '05 #8
"Silvio Bierman" <sb******@idfix.nl> wrote in message news:<40*********************@news.xs4all.nl>...
"Andy" <an************@yahoo.co.uk> wrote in message
news:b2**************************@posting.google.c om...
Hi all,

I'm sure this is old hat to all of you but could someone please tell
me if you can use FileReader to input data into an applet?

I developed this project as an application and am just trying to put
it on my website as an applet but it keeps saying "applet notinited".
I figure it might be because the program needs access to a file


Yes,

Applets are not allowed to do things like read files, do networking stuff to
other servers thanm the one that served the page they are on, accessing
ports etc. In short, in general an application will not run as an applet.
There are ways to grant applets all kinds of priviliges but that would at
least involve signing it (and buying an expensive certificate from Verisign
and the likes).

Silvio Bierman


Hi Steve,

Thanks. Is the best solution therefore to attempt to plug into the
server my applet is on using the URLConnetion class to read an html
file (would that even be allowed). I'm trying to put the applet in
some space I've got from geocities. Do you just change the file from
..txt to .html or is it a bit more complicated than that. :-@

Andy Chambers
Jul 17 '05 #9
pr******************@indiatimes.com (priyanka) wrote in message news:<32**************************@posting.google. com>...
[snipped...]
hi all
My que is related to J2ME. I am trying to show the loading screen
on a handset by filling of Gauge bars one by one.but ut doesnt worked
so. what it does that it just wait for some secs (coz of
Thresd.sleep()) and then fill all the bars simultaneously..here is the
code of program
[snipped...] public void commandAction(Command c,Displayable d) {
try {

for (int j=0;j<=7;j++) {
gauge.setValue(j);
Thread.sleep(1000);
}
}
catch(InterruptedException ie){
}
}
}

I am using J2ME Wireless Toolkit 1.0.4 with KToolbar.All solutions
will be welomed.
pink

From what little J2ME I recall, commandAction is some kind of event
handler, correct? To put it in simplified terms, J2ME's UI thread
has called your event handler - your event handler then hogs the
thread for 7 or so seconds, updating the gauge, but as you are running
*your* code on the UI's thread, the UI never has an opportunity to
update until you release control of the thread when your event handler
exits. (A race condition, in threading terms!)

As a general rule of thumb: when programming event handlers in Java,
you are running on someone else's thread - so get your work done and
get the hell out of there ASAP! ;-)

(The similar deadlock effect can be had by opening a 'Chooser' type
dialog from inside an event handler in Swing, and waiting for its
response.)

You'll have to find some other way of periodically calling the
code which changes the gauge status, one which does not hog the
UI's event firing thread. This could be as simple as firing off
a separate thread for your loop - or finding an in-built J2ME
mechanism to re-call actionCommand periodically.
-FISH- ><>
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dave D | last post by:
I just read something that spooked me. I'm a newbie working my way through "SAMS Teach Youself Java 2 in 21 Days." I used to code a bit in Symantec's Visual Cafe for Java about 3 years ago, but...
4
by: Jesper Matthiesen | last post by:
Hey sharks If I want an applet that functions in the largest possible number of browsers, which setup should I choose? Is it better to use AWT than Swing? The user is the average, potentially...
4
by: zalekbloom | last post by:
I noticed on my PC with win98/IE 6.028 applets are not working. Applets are working when I use Netscape 7.1. When I open the DOS win and I check for a Java version I am getting: C:\WINDOWS>java...
1
by: d.morel | last post by:
Hello all..this is driving me crazy... I cant run applets in IE6.0 using the embedded Oracle 10g server. here are my peticulars... - Windows XP no service packs (offline machine) - jre 1.4.2_03...
1
by: Justin | last post by:
Hi, We are researching options on which technologies to use for an advanced web application. We are planning on using DHTML as much as possible, but there are a few components that require more...
1
by: Jim Westwood | last post by:
Is it possible to write java applets in the python language. is that what jython does? I would realy like to write an applet but i dont know any java. I do have some python experience. Can you...
1
by: Vincent Montressor | last post by:
I'm playing around with writing my own panel applets, and I'm trying to figure out how to get my panel applets to be restored when I log in. As an experiment, I'm using the simple clock applet...
8
by: Andreas Røsdal | last post by:
Hi, Is there such a thing as python applets for web browsers? (eg. such as java applets?) I think that could be useful. Andreas R.
12
by: Wladimir Borsov | last post by:
On one of my web pages there is an java applets which works fine on my computer. However I noticed on some other computer that the run of java applets are disabled. I got an error message...
4
by: Neil Cherry | last post by:
I've seen references to using <applets ... > and document.applets to access public Java functions from Javascript. Do I still use document.applets with <object ...>? BTW, the FAQS page seems to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.