JApplet calls a Class. This Class needs Input
I am doing something in a JApplet. After the user click in a jButton called Execute, this JApplet use a class (Processing) to process some inputs which comes meanwhile this class (Processing) is running. I need some input from the user but not in the way of JOptionPane. I would like to show some more elegant dialog with checkboxes and buttons. How can I do this? Thx for help me!
I am doing something in a JApplet. After the user click in a jButton called Execute, this JApplet use a class (Processing) to process some inputs which comes meanwhile this class (Processing) is running. I need some input from the user but not in the way of JOptionPane. I would like to show some more elegant dialog with checkboxes and buttons. How can I do this? Thx for help me!
Similar Messages
-
Call function inside running class
Hey All,
i have a two question in classes.
1- i have class and i called its before and its running on runtime. i need to call function inside this class from another class, but without call the first one again, because if i called it, it will run default class function again
is this doable ?
2- What super() mean ?
Thanks a lot.this is the default call, and when i call the method by this way its will run the default class function before call the method.
here my example:
i need to call checkboxes function in ChannelsMain class without pass by the grey script.
Note: the call_cb is working and the trace is working
so i now the class is running, i need to call the checkboxes without ( var ci:YourClass = new YourClass(); )
package com.link
import fl.controls.CheckBox;
import flash.events.*;
public class ChannelsMain
var cbLength:uint = Main.PV.channel_id.length;
public function ChannelsMain()
// constructor code
for (var i:int = 0; i < cbLength; i++)
var cb:CheckBox = new CheckBox;
cb.name = Main.PV.channel_id[i];
cb.label = Main.PV.channel_name[i];
cb.x = 50;
cb.y = 50 + i * 30;
cb.addEventListener(Event.CHANGE,call_cb);
Main.MS.addChild(cb);
//call xml function
if(i == cbLength - 1)
new ChannelsXML();
private function call_cb(evt:Event)
trace(evt.currentTarget.name,evt.currentTarget.selected);
public function checkboxes(evt)
trace(evt); -
Me, Classes and Class rooms
Hi,
note : plz take your lunch on time :)
I have a class called as Datastructure(one of my favorite classes), this class has methods:
addKey(blah,blah...)
containsKey(blah...)
getKey(.....)
getValue(.....)
now I have to design a class clled Parameter, this class has to read patameters (from an ASCII file which does not change)into Datastructure so I extended the Datastructure class as
.blah blah...Parameter extends DataStructure ....{
Parameter's method readParameterFile reads the parameters and internally calles addKey method to fill in values. I am using few of the methods of DataStructure (containdKey, getKey,getValue.....).
Some of DataStructure's methods are not required(or not used )here in Parameter. How should I not include them, or what ever I have done is correct.
(one more thing) I want to call the Parameter's methods as Parameter.getKey()...(with out usingan object of Parameter)
I am STILL new to Object Oreanted programming plz suggest me some good online matrial to learn how-to about designing Classes and learn about object oreanted designingnote : plz take your lunch on time :)It will be another 23 hours in the current timezone.
I am STILL new to Object Oreanted programming plz
suggest me some good online matrial to learn how-to
about designing Classes and learn about object
oreanted designing
http://java.sun.com/docs/books/tutorial/java/index.html -
Need help making this class Runnable.
Hello,
This class (see below) is working fine the way it is but I have a little problem, I need to execute aprox 500+ commands and each command takes between 30sec to 3 minutes to complete which translate into hours for the job to finish.
I want to speed the process by multi-tasking and executing (possibly) all commands simultaniously by somehow making this class Threaded/Runnable (miltitasking). There must be something tricky about Runtime class and cannot figured it out.
Your help would be highly appreciated.
Regards,
Ulises
public class CmdTest {
public static void main(String[] args) throws java.io.IOException {
String outFile = "./ds8300/lsvogrp.txt";
PrintWriter bout = null;
try {
bout = new PrintWriter( new FileWriter(new File(outFile)));
} catch (IOException e) {
e.printStackTrace();
Runtime run = Runtime.getRuntime();
run.traceMethodCalls(true);
Process proc2 = run.exec("cmd /c dscli -user user -passwd psw" + "lsvolgrp -l");
BufferedWriter ot = new BufferedWriter(
new OutputStreamWriter(proc2.getOutputStream()));
BufferedReader br = new BufferedReader(
new InputStreamReader(proc2.getInputStream()));
BufferedReader er = new BufferedReader(
new InputStreamReader(proc2.getErrorStream()));
try {
String s;
while((s=br.readLine())!=null) {
System.out.println(""+s);
bout.println(s);
while((s=er.readLine())!=null) System.out.println("ERR:"+s);
bout.close();
System.exit(0);
}catch (Exception ie) { //catch (InterruptedException ie) {
System.out.println("Interrupted:"+ie.getMessage());}
}Seems like the same question you asked last year.
http://forum.java.sun.com/thread.jspa?threadID=5181153&messageID=9705196#9705196
The proper way to design software is to start at the beginning and design Classes. Not try to butcher that which is working.
You're running work outside the JVM and this work might interfere with other, similar work (the multi-threading issue.)
I'd start with paper and pencil and see what conflicts might arise. -
Is this class available CL_GUI_WDR_VIEWER? Urgent Solution Needed.
Hi Experts,
Please check the blog below.
/people/david.fernandespietroniro/blog/2008/06/19/web-dynpro-running-web-dynpro-applications-over-sapgui
In this blog he used CL_GUI_WDR_VIEWER to declare lr_viewer.
But when i tried this blog, i'm not able to locate this class.
I checked SE24. there is no class in this name.
My question is : Is there any other class available like CL_GUI_WDR_VIEWER.(To do the same blog).
Expecting Reply ASAP
Thanks & Regards
SM NizamudeenHello Nizamudeen,
This class was released with the version 700 of SAP_BASIS component. I'm writing a new blog that shows how to call web dynpros in later versions, but for while take a look at the program RSDEMO_HTML_VIEWER.
Regards. -
Revision: 21285
Revision: 21285
Author: [email protected]
Date: 2011-05-20 07:53:23 -0700 (Fri, 20 May 2011)
Log Message:
Need to change _parent, privateCall and instance properties from private to protected in order to extend this class for another project
Modified Paths:
blazeds/trunk/apps/ds-console/console/ConsoleManager.asRevision: 21285
Revision: 21285
Author: [email protected]
Date: 2011-05-20 07:53:23 -0700 (Fri, 20 May 2011)
Log Message:
Need to change _parent, privateCall and instance properties from private to protected in order to extend this class for another project
Modified Paths:
blazeds/trunk/apps/ds-console/console/ConsoleManager.as -
my daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks
If you know that you will not be asked to design GUI interfaces, and the C programming course will adhere to command line compilation environments, then get the Xcode command-line developer tools, and skip the extra complication of Xcode until you absolutely need it. Apple has kicked GNU C to the curb and is rightly so, using Clang/LLVM compiler technology.
Sign up for a free Apple Developer account using your Apple ID, and then visit the Mac Dev Center, and towards the bottom of the page, you will see additional downloads. Click on the associated, all down loads link. Know your OS X version beforehand, as the command-line tool releases are tied to general operating system versions, and the most recent Xcode version. That said, there are currently two March 9, 2015 command-line tools for Xcode 6.2 — one for OS X 10.9 Mavericks, and the other for OS X Yosemite. -
In J2ME which class do we need to call to do ENcryption/Decryption?
How many method we can implement from J2ME library?
Can we use Triple DES, DES, AES ? Which class do we need to see?Hi,
Generaly its not a good practice to modify SWCV you need to create in SLD then import it. Although if you want you can do it by opening SWCV in Repository then down the namespaces, you can see 2 check boxes named as Objects are original objects and Objects are modifiable. You need to check the option Objects are Modifiable.
Then you can change it. I'hv not tried but check if it helps?
BR
Sudhir -
How to call a custom action class present in one DC from a different DC
Hi Experts,
I have to implement one email functionality in my project.This functionality works fine if I use the Standard EmailAction class present in com.sap.isa.cic.customer package,but we need to change the email IDs in some cases so,we need to create a custom class.But if I create a custom Action class in Another DC(shext) and try to call this class from the config file present in the other DC(From where the Standard class was called),I am getting no Action Instance found for the declared Action(This Happens when the class is not present ).
From the error I interpreted that the presence of the Custom Action class is not recognised by the The DC.
Please confirm If my understanding is correct.
I also tried adding a a new public part in shrext and tried adding the same in the used dc for the DC from where I am trying to call the class.But the activity fails and it gives me the error that the DCs are Broken.Do I need to build the DCs after adding a public part or a used DC?
Please answer If anybody has faced the same issue or has a solution to it.
Thanks
Arpita Saxena
Edited by: ArpitaSaxena on Jun 23, 2011 6:51 AM
Edited by: ArpitaSaxena on Jun 23, 2011 7:01 AMHi All,
I was able to resolve this issue myself.
I had to include the DC crm/isa/lwc and the DC mail in the used DCs of SHREXT .
So,all the jars got included automatically and I was able to create a new custom class for the required functionality.
Its working fine now. -
I have script, which has been working fine in CS3. In CS4 ( app.version = 6.0.1.532 ) however, I get an error using extractLabel, after reading out a couple of other properties from a textframe:
frameObject.extractLabel('name')
Error: TextFrame.extractLabel() cannot work with instances of this class
Up until reading one of the "normal" properties, such as (frameObject.)contents I can call the frameObject.extractLabel('name') without errors, but after "looking at" (by assigning to a variable in code, or by getting the value in the javascript console), the contents propery (or as it seems any normal property) the extractLabel method results in the error above.
It seems to work to move all of the frameObject.extractLabel calls to the beginning of the function, but I don't think I should need to do that.
It might very well be the case that the label read by extractLabel has no contents, and has never been assigned. Is there a change in behaviour from CS3 in that sentence? If so, and if thats the reason for the error, is there then a way to determine whether the label has ever been assigned?
Is this error familiar to anyone else?
Best regards,
AndreasHi Andreas,
Interesting problem!
Your problems are caused by some peculiarities of itemByID. itemByID doesn't cast the object type properly. Dirk wrote about some aspects of this some time ago. If the scripting engine was strongly typed, this issue would probably be impossible but that would make scripting a lot more of an elitist activity!
Your problem is that the object type is PageItem and you are accessing a TextFrame property (content). This seems to throw the object type for a loop.
Using getElements() causes the scripting engine to rebuild the reference to the object correctly.
Take a look at this code, which illustrates the issue quite well...
var myDocument = app.documents.add();
myDocument = app.activeDocument;
myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
var myTextFrame = myDocument.pages.item(0).textFrames.add({geometricBounds:[72, 72, 144, 288], contents:"test"});
var myId = myTextFrame.id;
var pgItm = myDocument.pageItems.itemByID(myId);
alert(pgItm instanceof PageItem);
alert(pgItm instanceof TextFrame);
var thisBounds = pgItm.geometricBounds;
var x = pgItm.extractLabel('mandatory');
var pgItm = myDocument.textFrames.itemByID(myId);
alert(pgItm instanceof PageItem);
alert(pgItm instanceof TextFrame);
var thisName = pgItm.extractLabel('name');
var thisContents = pgItm.contents;
var x = pgItm.extractLabel('mandatory');
Harbs -
Calling Custom XSLT java class from BPEL in SOA Suite 11g
Hi All,
Morning...need some help with this issue...we are currently on SOA Suite 11g (11.1.1.4) version.
Earlier while we were on SOA Suite version 10g (10.1.3.3) we were calling the custom java classes from the xsl mapping for complex transformation and for this we were placing the .class file as .jar file at the location mentioned here $OC4J_HOME/j2ee/home/applib directory and then mentioning the namespace as http://www.oracle.com/XSL/Transform/java/{$classname$} in the XSLT mapping file.
Now in SOA Suite 11g if we need to retain similar functionality for external custom java calls could someone please help us where do we need to put the .jar file now ..
exactly at which directory location/path and on which instance/server (application server instance or middle tier instance ) we need to put this .jar file
Currently we are stuck and need some help with this.
With thanks & RegardsHi Eric & Anuj,
Thanks for replying , sorry for checking on this now...
here at this path /opt101/app/oracle/SOAD/SOA11gR1/fmw/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1
we got the ora.soa.ext.jar file and extracted it to get the MANIFEST.mf file ..have mentioned below.
Now if we need to link our custom .jar file named customfunctions.jar so we need to mention it as below is this correct :
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 17.0-b17 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle
Implementation-Title: Oracle SOA EXT
Implementation-Version: 11.1.1
Product-Name: Oracle SOA EXT
Product-Version: 11.1.1.4.0
Specification-Version: 11.1.1
Extension-Name: oracle.soa.ext
Class-Path: classes/
Class-Path:customfunctions.jar classes/ -- is this the way to mention (means we need to add this additional line or we need to add to the existing line at Class-Path: classes/)
2.
Eric the Alternative method mentioned in your update :
Open a command prompt and change the current directory to the oracle.soa.ext_11.1.1 directory ,
then execute the build.xml file in the oracle.soa.ext_11.1.1 folder using Ant
Now could someone please guide us regards this ANT means how does it work and its relation to the build.xml file and how do we check whether we have ANT utility available or not..
not much conversant with this ANT hence asking here..would lookout for your reply
thank you -
Class.this.method overriding inheritance trying to understand
Hi I saw a piece of code that calls MyClass.this.aFunctionOverriddenByMeThatIsInMySuperClass ()
Im just looking for some clarity on how this works what function this actually calls and why someone would write code in this manner.
I have created a simpler version below
2 class A and B and there basic functionality is described in each
class A {
public A (){};
public int func1 () { return 1; }
class B extends A {
public B (){};
public int func1() { return 0; } //note this returns 0 where A.func1 = 1
public int myFunc() { return B.this.func1(); }
//public int myOtherFunc() { return A.this.func1(); } //NOT LEGAL wont compile
B.java:5: not an enclosing class: A //pardon the stupidity but what is an enclosing class??
public int myOtherFunc() { return A.this.func1(); }
class D extends B {
public D (){};
public int func1(){ return 4; }
class C
public static void main (String [] args)
A a = new A();
B b = new B();
D d = new D();
System.out.println(a.func1()); //prints 1
System.out.println(b.func1()); //prints 0
System.out.println(b.myFunc()); //prints 0
System.out.println(d.myFunc()); //prints 4
I guess my assumption is that using MyClass.this.someOverriddenFunction allows the subclass to have more control ??
any thought or comment would be much appreciated.
thanksDo you know what inner classes are? Inner classes are classes that are defined within another class. If an inner class is not declared as static, it needs an instance of the class it is defined within to exist, this is the enclosing class. MyClass.this can be used so that the inner class can explicitly invoke methods on it's enclosing instance
-
Calling repaint from other Class file.
Hi,
First of all i am pretty new to Java so I hope you understand what I am trying to explain..
I am trying to create an applet which draws some polygons on the screen. For the drawing of these polygons I have created another class which is located in another package but the same project. I plan to use this second package as some kind of library so that i can simple call 2 or 3 functions in future applets to draw these polygons (which always have the same shape). In the library file i have created a contructor, a draw function and some other functions to change some properties. I also created a function that created a popup window as soon as i click on one of the polygons i have created. In the popup some buttons are available which change the color of the polygon. All this works fine, but the problem i have is the following:
When i click a button the main class (in package 1) needs to be repainted for the changes to be visable. But the main class can always be a different one. Is it possible to check in the class in the library package, which class from the main package called the class, and execute a repaint() on that class. So i have the following situation:
Package 1 (Applets):
package applets;
class myApplet extends Applet implements .... {
private Tank tank1 = new Tank(20, 20, 100, 200);
private Tank tank2 = new Tank(250, 20, 100, 200);
public void paint(Graphics g) {
tank1.drawTank(g);
tank2.drawTank(g);
public void mouseClicked(MouseEvent e) {
tank1.openWindow();
tank2.openWindow();
Package 2 (Library):
package applets.library;
class Tank {
public Tank(int xPos, int yPos, int height, int width) {
public void drawTank(Graphics g) {
public void openWindow() {
new myWindow("Window1");
public class myWindow extends Frame {
public myWindow(String name) {
show();
public boolean action(Event e, Object arg) {
return true;
So what i want to do is: In class Tank in the public class myWindow in the method action, i want to call the repaint() of the class myApplet
I hope my problem is clear to you, as you may have noticed i have a little trouble explaining it clearly..First of all thanks a lot for your reply and sorry for my way of programming. Like i said i am pretty new to Java, i am actually only programming for about 2 weeks and trying to learn from some examples on the internet.
I dont really understand what you want me to do, is it maybe possible to give a little bit of sample code? That would help me a lot.
Maybe some background information about the project will help a bit too.
I work at a company that develops automation solutions. We program PLC's and SCADA systems. Now Siemens has some PLC's that support Java applets which make it possible to visualize industrial processes. Now i am trying to figure out if it is possible to start developing own java applets for visualisation in the future. Since most programmers here have no experience in any higher programming language i want to keep it as simple as possible, by developing libraries that do the most of the programming work for them.
Now i want to create the first part of this library by programming some kind of storage tank. This tank always has a valve. when i click on the valve a popup should open with the operation button to open of close that valve. When a valve is opened it should be colored green and when its closed it should be colored gray or something. The Tank class has a couple of methods:
drawTank(); to draw the tank in my applet,
openValve(); to open the Valve,
closeValve(); to close the Valve,
After all this is created i want to be able to use this class in all my other classes and create a tank by simple making a new Tank object, draw it on my applet using the drawTank() method and open or close the Valve using the other 2 methods, however when i open or close the Valve the color of the valve should change so i must be able to call the repaint of all the classes that use my Tank class, but i want to do that INSIDE my Tank class.
If there is another way of doing this i would love to hear so, but i would help me a lot if you can explain in a little bit of sample code. It doesn't have to be really long or detailed.
Thnx in advance -
How to pass params to another class which accepts keyboard input?
How can I pass params to a stand-alone Java class that, when executed, gathers params using readLine()?
In other words, MyClass, when executed from the command-line, uses readLine to gather params for program execution. I'd like to test this class by calling it from another class using Runtime.exec("java MyClass") or calling MyClass.main(args) directly. But, how can I simulate the input expected from the keyboard?
Thanks!Alright, so it looks like this:
proc = Runtime.getRuntime().exec("java Client");
br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
bw = new BufferedWriter(new OutputStreamWriter(proc.getOutputStream()));
bw.write("test");
bw.newLine();
But, how can write doesn't seem to be passed to the original client class.
Suggestions? -
How to run a Java class in JDeveloper - with Input parameters
Folks,
I need to run Forms 10g trace and do not have access to the Dos command line (no Programs-ACcessories-Comand prompt). I am allowed to run Batch files though.
So really I need to run class "oracle.forms.diagnostics.Xlate", but need to give Input Parameter to this class. I know to load JDeveloper and open this class, but when I execute it it gives me the following error.
My question is HOw do I input the File name to this Class when I execute it from JDeveloper.
ERROR: You must specify an input datafile
Exception in thread main
java.lang.NoClassDefFoundError: oracle/forms/registry/MessageManager
at oracle.forms.diagnostics.Xlate.printUsage(Unknown Source)
at oracle.forms.diagnostics.Xlate.readArgs(Unknown Source)
at oracle.forms.diagnostics.Xlate.<init>(Unknown Source)
at oracle.forms.diagnostics.Xlate.main(Unknown Source)
Process exited with exit code 1.To specify program arguments
1. Select Tools>Project Properties.
2. Select Run/Debug.
3 Select the Default Configuration and select Edit.
4. Specify the program arguments in the Program Arguments field.
Maybe you are looking for
-
Can anyone tell me why I'm getting a missing return statement error in this code? import java.awt.*; * Write a description of class Flower here. * @author (your name) * @version (a version number or a date) public class Flower protected FilledOva
-
Issue with informatica 8.1.1 sp4 installation
Hi All, Here is the Issue. I am trying to install informatica server 8.1.1 SP4 patch and already installed informatica server 8.1.1. After installing 8.1.1 SP4 patch few minutes, it asking for insert new media. "Pls insert new disk1 or select Browse
-
How to delete backend system data from GRC,GRC 10 AC
Hello experts, we have connected multiple ECC systems to GRC by creating connectors with respect to each system and currently we are using,now due to some reasons customer requested to delete complete data from one of the ECC system from GRC. we are
-
Mail 1.3 for 10.3.9 version : application refuse to function correctly
My problem is the following : when I open Mail 1.3, on my 10.3.9 version, the application refuse to function correctly : the first window wich must open at the beginning doesn't want to open, and when I want to quit this, I can't quit it normaly, it'
-
Photoshop CS4 flyer looks horrible when being printed
Hello How can I Improve the image quality of a flyer I created in photoshop, CS4. On the computer it looks ok but the printer has told me it looks low quality in real life? If someone could tell me how to make it higher resolutioned and with better