Results 1 to 10 of 10
- 04-01-2009, 11:51 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 8
- Rep Power
- 0
clear screen prompt using java code
hi,
i want implement clear screen function in menu item ...
when click on clear screen menu then command prompt's all screen is clear . and command prompt display...
if it possible then guide(hint)/code for solution for this problem ..
as soon as possible...
please i m in big trouble...."
- 04-02-2009, 03:06 AM #2
Senior Member
- Join Date
- Jul 2008
- Posts
- 125
- Rep Power
- 0
No java programmer understands this request.
Nobody can help you because they do not
know what you mean by a "screen."
Maybe it's a panel,
maybe it's a canvas,
maybe it's a frame,
maybe it's the console.
People may be waiting for a clearer
description of what you want to clear.Last edited by paul pasciak; 04-02-2009 at 11:20 PM. Reason: "Graphics g" missing everywhere
- 04-02-2009, 08:09 AM #3
Senior Member
- Join Date
- Jan 2009
- Posts
- 671
- Rep Power
- 5
My guess is you are referring to a terminal window? If so, then the simplest approach is to use Runtime.exec to issue the command, since it is platform specific.
- 04-02-2009, 08:11 AM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
System.out.println() about 100 times.
- 04-02-2009, 07:23 PM #5
Member
- Join Date
- Apr 2009
- Posts
- 8
- Rep Power
- 0
clear screen of applet
hi,
sorry i m not specify ..
now...
when ever click on clear button then it clear the applet screen and reload and the command prompt session continue..
actually i m using command prompt in my applet ,,, i don't want to clear command prompt....but when clear button click then clear screen but prompt is running../
if u help then please give me idea for implementation or how i start..
- 04-02-2009, 08:43 PM #6
Senior Member
- Join Date
- Jul 2008
- Posts
- 125
- Rep Power
- 0
This advice pertains only to the applet.
I will assume you already know how to make
your code respond to an actionEvent.
A tricky part of applets to to know that
they are ALWAYS clearing and repainting
themselves.
Your task is to interfer with this cycle somehow.
The cycle begins when the applet is nudged into
repainting itself.
You don't see this in your code, but the applet
jumps to code called "update(Graphics g)".
This code clears the applet, then jumps to
your "paint(Graphics g){ .. }" method.
My advice is that you play with the "update(Graphics g)"
method by overriding it. Try something like
to get the feel of how it fits into the "paint(Graphics g)"Java Code:public void update(Graphics g){ setBackground(Color.orange); paint(g); }
process.
Later, have your clearButton's actionListener set a
flag and experiment by testing this flag withinJava Code:boolean eraseGraphics;
"the update(Graphics g)" method.Last edited by paul pasciak; 04-02-2009 at 11:19 PM.
- 04-02-2009, 08:54 PM #7
Member
- Join Date
- Apr 2009
- Posts
- 8
- Rep Power
- 0
clear screen applet
hi,
thanks for giving this help..
but if u give one example code then easily understand..
menu is implemented in applet..
help me i m in trouble and i m in beginner in applet ......
- 04-02-2009, 11:33 PM #8
Senior Member
- Join Date
- Jul 2008
- Posts
- 125
- Rep Power
- 0
There are too many details to cover. Here is the first one:
You might have several BIG issues that need
to be covered with your applet. I'm covering
one detail that you can easily experiment on
in your applet (by the way, I updated #6 in
this thread because I left out some important
parts).
The "update(Graphics g)" method is responsible
for clearing the applet's display. OVERRIDE IT
with this code:
Then override it with this code:Java Code:public void update(Graphics g){ setBackground(Color.orange); paint(g); }
Then override it with this code:Java Code:public void update(Graphics g){ setBackground(Color.black); paint(g); }
Then override it with this code:Java Code:public void update(Graphics g){ setBackground(Color.cyan); paint(g); }
This underscores a pivitol concept inJava Code:public void update(Graphics g){ setBackground(Color.red); paint(g); }
painting graphics in AWT. If you can't
do the above and gain anything from
it, this tells me something about you.
- 04-02-2009, 11:49 PM #9
Member
- Join Date
- Apr 2009
- Posts
- 8
- Rep Power
- 0
clear screen applet
hi,
thanks for this help..
i am join lots up forum ,but you give satisfy answer ..
if u give me whole code then i easily implemented ...
i m beginner.. i have no time to learn full applet stuff .....because.. i have dead line in my work...
i want to combine this code with my applet class..
which i m implement in my application which contain SSH/TELNET applet JTA26.jar file which provide facility for ssh connection to server.. with command prompt
so that's why i need complaint code ..because here very complexity to combine this code ....
i want to implement clear screen portion into my application menu...
so.. if you give complete code then it is good for me.
- 04-04-2009, 12:47 AM #10
Senior Member
- Join Date
- Jul 2008
- Posts
- 125
- Rep Power
- 0
Show the basic part of your code.
I'm confused.
Your request sounds like this:
"I am a giant, as big as a mountain.
I need a bandage. I will not tell you
where I need the bandage, but I
insist that you find my wound and
mend it."
First I thought you referred to a simple
applet, now it sounds like you are
referring to complex, proprietary code.
Similar Threads
-
Need For Clear Screen
By adithya4u4ever in forum New To JavaReplies: 8Last Post: 03-08-2009, 08:41 AM -
Blank Screen while navigating from one screen to another
By mohana.krishna in forum Java ServletReplies: 0Last Post: 03-03-2009, 05:03 PM -
Clear Screen in Console based programs
By kirly in forum New To JavaReplies: 5Last Post: 02-05-2009, 05:59 AM -
Connecting a splash screen to a code : HELP !!!
By mobeenkhan in forum NetBeansReplies: 0Last Post: 08-02-2007, 05:15 PM -
Clear screen in java
By lenny in forum New To JavaReplies: 1Last Post: 07-30-2007, 09:43 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks