Urgent... java.io , java.lang.class..
Hi there,
When i choose the file from JFilechooser, for example is a .class file, how do i make the .class file be read by java.lang.class as a class object, so i can get information from the class object ?
Is it related to java.io that make it become stream or something.
Is urgent for my school assignment, please help, Thanks in advance.
Hi there,
When i choose the file from JFilechooser, for example
is a .class file, how do i make the .class file be
read by java.lang.class as a class object, so i can
get information from the class object ?
Is it related to java.io that make it become stream or
something.
Is urgent for my school assignment, please help,
Thanks in advance.First of all, java.lang.class does not exist. Just java.lang.Class.
1. Read the content of a file into a byte[]
2. Use defineClass method from ClassLoader in order to get the Class object (you can use the system class loader obtained by static method ClassLoader.getSystemClassLoader() )
Similar Messages
-
Urgent Plz reply: java.lang.Class not found exception
Hi All,
I am novice to j2me, I am tryiing communicate data between client and Java server. I have given project name client and midlet class name FileViewer.java.
It is compiling succesfully
but when I run it , it is giving error
Unable to create Midlet FileViewer.java
java.lang.classnot found excetption: FileViewer.java
at com.sun.midp.midlet.selector.commandaction(+47)
at javax.microedition.lcdui.Display$displayaccessor.commandaction.(+152)
at com.sun.kvem.midp.lcdui.EmulEventHandler$eventloop.run(+459)
Here is the code
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
public class FileViewer extends MIDlet implements CommandListener
private Display display; // Reference to Display object
private TextBox tbViewer; // View file contents in a textbox
private Command cmView; // Command to view file
private Command cmExit; // Command to exit
private String url = "http://www.corej2me.com/midpbook_v1e1/scratch/fileViewer.hlp";
public FileViewer()
display = Display.getDisplay(this);
// Define commands
cmView = new Command("View", Command.SCREEN, 2);
cmExit = new Command("Exit", Command.EXIT, 1);
tbViewer = new TextBox("Viewer", "", 250, TextField.ANY);
tbViewer.addCommand(cmView);
tbViewer.addCommand(cmExit);
tbViewer.setCommandListener(this);
public void startApp()
display.setCurrent(tbViewer);
private void viewFile() throws IOException
HttpConnection http = null;
InputStream iStrm = null;
try
// Create the connection
http = (HttpConnection) Connector.open(url);
// Client Request
// 1) Send request method
http.setRequestMethod(HttpConnection.GET);
// 2) Send header information (this header is optional)
http.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0");
// 3) Send body/data - No data for this request
// Server Response
// 1) Get status Line
System.out.println("Msg: " + http.getResponseMessage());
System.out.println("Code: " + http.getResponseCode());
// 2) Get header information
if (http.getResponseCode() == HttpConnection.HTTP_OK)
// 3) Get data (show the file contents)
iStrm = http.openInputStream();
int length = (int) http.getLength();
if (length > 0)
byte serverData[] = new byte[length];
iStrm.read(serverData);
tbViewer.setString(new String(serverData));
Alert alTest = new Alert("Alert Test", new String(serverData), null, null);
display.setCurrent(alTest);
finally
// Clean up
if (iStrm != null)
iStrm.close();
if (http != null)
http.close();
public void pauseApp()
public void destroyApp(boolean unconditional)
public void commandAction(Command c, Displayable s)
if (c == cmView)
try
viewFile();
catch (Exception e)
System.out.println(e.toString());
else if (c == cmExit)
destroyApp(false);
notifyDestroyed();
If some body has knowledge why this error is coming plz share wiht me Its urgent .
Thanks in advance.
ThanxNo, the "-g" version just means it has the debug flag turned on when they compile it.
Your problem is CLASSPATH and how to set it properly.
Use the -classpath option on java.exe when you run. Read the javadocs on the tools to find out how.
% -
Error: could not be converted to [class java.lang.Class].
I am newbie to JDeveloper (10.1.2) on winxp and i was trying to setup the example from the following url http://radio.weblogs.com/0129487/2003/09/19.html
It is a how to on "Executing Toplink Queries using JavaBean DataControl "
Any help would be greatly appreciated.
Near the bottom on step "In StrutsPageFlow diagram, select allEmpsDA Data Action, right mouse and chooe Run" i get a the following runtime errors:
Validation Error
You must correct the following error(s) before proceeding:
JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.toplink.exceptions.ConversionException, msg= Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.Employees
JBO-29000: Unexpected exception caught: oracle.toplink.exceptions.ConversionException, msg= Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.Employees
Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.EmployeesThis error is happening on a read.
Here is the mapping descriptor:
<database-mapping>
<attribute-name>SuppItemCollection</attribute-name>
<read-only>false</read-only>
<reference-class>package.SuppItem</reference-class>
<is-private-owned>false</is-private-owned>
<uses-batch-reading>false</uses-batch-reading>
<indirection-policy>
<mapping-indirection-policy>
<type>oracle.toplink.internal.indirection.NoIndirectionPolicy</type>
</mapping-indirection-policy>
</indirection-policy>
<container-policy>
<mapping-container-policy>
<container-class>java.util.Vector</container-class>
<type>oracle.toplink.internal.queryframework.ListContainerPolicy</type>
</mapping-container-policy>
</container-policy>
<source-key-fields>
<field>SUPP.REQ_NUM</field>
</source-key-fields>
<target-foreign-key-fields>
<field>SUPP_ITEM.REQ_NUM</field>
</target-foreign-key-fields>
<type>oracle.toplink.mappings.OneToManyMapping</type>
</database-mapping>
Object model has a Supp class that has a collection of SuppItem(s). I was allowing the Mapping Workbench to create the Java Source. I'm not to fond of that, but I thought it would be easiest to get things going.
The datamodel is similiar to the class model.
Thanks for the help,
Mike -
Developer 10g error Java.Lang class not found
Hi
My application is live on static IP but when i try to access it from some systems i get the error after downloading Jinitiator
Java.lang class not found exception:Oracle forms engine main
is this problem of browser or something else? how can i solve
RegardsHi
My application is live on static IP but when i try
to access it from some systems i get the error after
downloading Jinitiator
ava.lang class not found exception:Oracle forms
engine main
is this problem of browser or something else? how can
i solve
RegardsSee the JInitiator "Proxies" configuration tab from the control panel, try checking the "Use Browser Settings" checkbox, that does the trick sometimes.
Tony -
Java.lang.class not found
Hi,
I configured scenario FILE TO JDBC, the sender channel is successful but in the receiving I am getting the error that java.lang.class not found.
In the receiver communication channel, I gave "com.microsoft.jdbc.sqlserverdriver".
what database connection parameters need to be given??
Thanks,
Satish.Whats your database ?
As Suresh said, did you deploy your JDBC driver ?
How to ?
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how to install and configure external drivers for jdbc and jms adapters.pdf
After configuring your communication channel, did you check the Adapter Monitor
XI SP > 09
http://<host>:5<sysnum>00/rwb -> Component Monitoring -> All Display -> Adapter Engine -> Adapter Monitor
XI SP <= 09
http://<host>:5<sysnum>00/AdapterFramework
Oracle Driver & Connection:
JDBC Driver: oracle.jdbc.driver.OracleDriver
Connection: jdbc:oracle:thin:@<hostname>:<port_umber>:<database_name>
SQL Server Driver & Connection:
JDBC Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
Connection = jdbc:microsoft:sqlserver://hostname:1433;DatabaseName=<DBName>
regards
Shravan -
Java.lang.Class- getFields() results in JVM crash when called through JNI
From a C++ application, I use Invocation APIs to create a JVM and call some Java methods using JNI
I get a crash in jvm.dll with EXCEPTION_ACCESS_VIOLATION
when I try to call "getFields" method of java.lang.Class in order to get the Fields of the java class
This method call, should return a java/lang/reflect/Fields[] on success
I am able to get the method ID of this method by using pEnv->GetMethodID(..)
However, when I call this method using CallObjectMethod(..), HotSpt JVM crashes with access violation with the dump given below.
Any clues on how to debug and find the problem?
Or has anyone tried getting the fields of a Java class from C++ by calling reflection APIs uing JNI?
Thanks in advance!
Sample code
jclass testerClass = pEnv->FindClass("com/test/Tester");
jmethodID cid = pEnv->GetMethodID(testerClass,"<init>","()V");
if(NULL == cid)
pEnv->ExceptionDescribe();
jobject testerObject = pEnv->NewObjectV(testerClass, mid);
jmethodID mid = pEnv->GetMethodID(testerClass, "getClass",
"()Ljava/lang/Class;");
jobject clsObj = (jobject)pEnv->CallObjectMethod(testerObject, mid);
pEnv->ExceptionDescribe();
jclass jCls = pEnv->GetObjectClass(clsObj);
jmethodID midGetFields = pEnv->GetMethodID(jCls, "getFields",
"()[Ljava/lang/reflect/Field;");
jobjectArray jobjArray = (jobjectArray)pEnv->CallObjectMethod(testerObject, midGetFields);
pEnv->ExceptionDescribe();
Crash dump
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x809E69F
Function=JVM_FindSignal+0x11505
Library=D:\Java\j2re1.4.2_03\bin\client\jvm.dll
Current Java thread:
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.privateGetPublicFields(Unknown Source)
at java.lang.Class.getFields(Unknown Source)
Dynamic libraries:
0x00400000 - 0x00419000 E:\SC\SC12.1\SCApplications\SNMP\Bin\JNITester.exe
0x77F50000 - 0x77FF7000 C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000 C:\WINDOWS\system32\kernel32.dll
0x10000000 - 0x10023000 E:\SC\SC12.1\SCApplications\SNMP\Bin\JniUtils.dll
0x00320000 - 0x00332000 E:\SnmpIpmNativeTestDriver\MTFStubHelper.dll
0x00340000 - 0x0035B000 E:\SnmpIpmNativeTestDriver\MTFXMLFileAPI.dll
0x12000000 - 0x122B1000 e:\sc\sc12.1\bin\xerces-c_2_2_0D.dll
0x77DD0000 - 0x77E5D000 C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78086000 C:\WINDOWS\system32\RPCRT4.dll
0x10200000 - 0x1026C000 e:\sc\sc12.1\bin\MSVCRTD.dll
0x102A0000 - 0x102B7000 e:\sc\sc12.1\bin\MSVCIRTD.dll
0x5F800000 - 0x5F8E9000 e:\sc\sc12.1\bin\MFC42uD.DLL
0x77C70000 - 0x77CB0000 C:\WINDOWS\system32\GDI32.dll
0x77D40000 - 0x77DCC000 C:\WINDOWS\system32\USER32.dll
0x5F700000 - 0x5F746000 e:\sc\sc12.1\bin\MFCD42uD.DLL
0x5F500000 - 0x5F5C6000 e:\sc\sc12.1\bin\MFCO42uD.DLL
0x10480000 - 0x104FE000 e:\sc\sc12.1\bin\MSVCP60D.dll
0x15020000 - 0x15042000 e:\sc\sc12.1\bin\SCTraceLib.dll
0x6D510000 - 0x6D58D000 C:\WINDOWS\System32\dbghelp.dll
0x77C10000 - 0x77C63000 C:\WINDOWS\system32\msvcrt.dll
0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
0x00360000 - 0x0037D000 e:\sc\sc12.1\bin\SCFileManager.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\System32\PSAPI.DLL
0x00420000 - 0x00580000 e:\sc\sc12.1\bin\BctCoreCL.dll
0x5D920000 - 0x5D929000 C:\WINDOWS\System32\RPCNS4.dll
0x71B20000 - 0x71B31000 C:\WINDOWS\system32\MPR.dll
0x71C20000 - 0x71C6E000 C:\WINDOWS\System32\NETAPI32.dll
0x71AB0000 - 0x71AC5000 C:\WINDOWS\System32\WS2_32.dll
0x71AA0000 - 0x71AA8000 C:\WINDOWS\System32\WS2HELP.dll
0x15000000 - 0x15012000 e:\sc\sc12.1\bin\CTEventLog.dll
0x773D0000 - 0x77BC2000 C:\WINDOWS\system32\SHELL32.dll
0x70A70000 - 0x70AD4000 C:\WINDOWS\system32\SHLWAPI.dll
0x771B0000 - 0x772D1000 C:\WINDOWS\system32\ole32.dll
0x77120000 - 0x771AB000 C:\WINDOWS\system32\OLEAUT32.dll
0x1F7A0000 - 0x1F7D6000 C:\WINDOWS\System32\ODBC32.dll
0x77340000 - 0x773CB000 C:\WINDOWS\system32\COMCTL32.dll
0x763B0000 - 0x763F5000 C:\WINDOWS\system32\comdlg32.dll
0x08000000 - 0x08138000 D:\Java\j2re1.4.2_03\bin\client\jvm.dll
0x76B40000 - 0x76B6C000 C:\WINDOWS\System32\WINMM.dll
0x5FD00000 - 0x5FD0D000 C:\WINDOWS\System32\MFC42LOC.DLL
0x71950000 - 0x71A34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll
0x1F840000 - 0x1F857000 C:\WINDOWS\System32\odbcint.dll
0x5DAC0000 - 0x5DAC7000 C:\WINDOWS\System32\rdpsnd.dll
0x00FE0000 - 0x00FE7000 D:\Java\j2re1.4.2_03\bin\hpi.dll
0x01000000 - 0x0100E000 D:\Java\j2re1.4.2_03\bin\verify.dll
0x01010000 - 0x01029000 D:\Java\j2re1.4.2_03\bin\java.dll
0x01030000 - 0x0103D000 D:\Java\j2re1.4.2_03\bin\zip.dll
0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\imagehlp.dll
Heap at VM Abort:
Heap
def new generation total 576K, used 132K [0x15050000, 0x150f0000, 0x15530000)
eden space 512K, 25% used [0x15050000, 0x15071250, 0x150d0000)
from space 64K, 0% used [0x150d0000, 0x150d0000, 0x150e0000)
to space 64K, 0% used [0x150e0000, 0x150e0000, 0x150f0000)
tenured generation total 1408K, used 0K [0x15530000, 0x15690000, 0x19050000)
the space 1408K, 0% used [0x15530000, 0x15530000, 0x15530200, 0x15690000)
compacting perm gen total 4096K, used 964K [0x19050000, 0x19450000, 0x1d050000)
the space 4096K, 23% used [0x19050000, 0x191410e0, 0x19141200, 0x19450000)
Local Time = Wed Aug 25 21:06:44 2004
Elapsed Time = 0
# HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
# Error ID : 4F530E43505002EF
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)You are right, I tried getting the java.lang.Class reference for the com.test.Tester by calling getClass() on com.test.Tester
And using this jclass reference for java.lang.Class, I tried getting the method ID of getFields and eventually the Field[]
Thanks for the help
I have some more questions.
Assumption - Using JNI, I got the fields array of com.test.Tester and I am iterating through the fields
1.Assuming that the Tester class had an Integer field say m_nIntVal, then once I get the jobject equivalent of this Field in C++.
Now I need to get the type of the field (I call the method java.lang.reflect.getType() from JNI)
This gives me a jclass reference to it's type i.e java.lang.Integer
2.I need to get the name of this type i.e I want to get the name of the type in a string as "java.lang.Integer"
For this, on the jclass reference of java.lang.Integer got in Step 1, I call getClass() from JNI (to get the java.lang.Class) and then getName()
Now, for calling getClass(), I need a temporary object reference corresponding to the jclass of java.lang.Integer, The problem is that Integer does not have a default constructor, so my call to create the jobject fails.
But, since I do not know that I am constructing an Integer (remember that is what I am trying to find out - getType), I cant pass any values to constructor
Now, how do I go about creating a jobject of Integer, without knowing that I am constructing that, as this does not have a default constructor without parameters
Also, I tried using AllocObject to get the jobject and then tried to get the method ID of getClass(). Even this failed
3. If the com.test.Tester class had a primitive "int" field, say m_nPrimitiveInt
for which java provides a Class representation, I am able to get the jclass reference to the type of m_nPrimitiveInt
Now, how do I get the name of the type as "int" in a string?
Forllowing a similar procedure like in Step 2 fails when I try to pass the jclass reference to the type of m_nPrimitiveInt to the GetMethodID
with the error FATAL ERROR in native method: JNI received a class argument that is not a class
Can you tell me what is the way out?
Thanks in advance,
Also, can I mail you with some doubts that I have? If its ok, please contact me at [email protected] -
Problems with java.lang.Class in JDK1.3
Hi,
I have 3 problems with the reflection in java.lang.Class:
1) In the specification of method java.lang.Class.getDeclaredFields() is wrote:
"Returns .... This includes public, protected, default (package) access, and private fields ..."
This means, that all private fields should be return too. But some private methods are not given back. ????
2) In java.lang.Class.getDeclaredMethods()
some public methods are not return. ????
3) In java.lang.Class.getDeclaredMethods()
If Class is an interface. The same problem like 2) ????
Are they errors of java.lang.Class in JDK1.3 ????
Thanks & sincerely.Not sure it makes a difference, but you left off the last part of the quote:
This includes public, protected, default (package) access, and private classes and interfaces declared by the class, but excludes inherited classes and interfaces.
Are these missing methods from inherited classes, or are they declared in the class itself? -
Is a jclass object always a java.lang.Class object?
In a native method, I'm receiving a jobjectArray called "args" as a parameter. I'm writing this:
jclass cls1 = env->GetObjectClass(args);
jmethodID mid1 = env->GetMethodID(cls1, "isArray", "()Z");
but this returns 0, indicating there is no isArray in the jclass returned by GetObjectClass. On the other hand, this works:
jclass cls2 = env->GetObjectClass(env->GetObjectClass(args));
jmethodID mid2 = env->GetMethodID(cls2, "isArray", "()Z");
Why??
When I call getMethods() (via JNI) on cls1, I get only the methods of java.lang.Object. When I do that on cls2 I get the methods of java.lang.Class.Oops, I answered my own question. The jclass object represents the class of args, so its methods are those of the class of args, not those of java.lang.Class. I was misinterpreting what GetMethodID does -- it gets methods that would be returned by getMethods() in the Class object, not the methods of the Class object.
-
I want to call a specified method of one class dynamically. I use the method
"getMethod()" in package "java.lang.Class" to get method and "invoke()" in
" java.lang.reflect.Method " to invoke method.
The problem is as following :
1. There are two argument in this method "getMethod(String MethodName , Class[] paremterTypes)" in package "Class". I have no idea about the second parameter " Class[] parameterTypes ".what does the argument exactly mean ?
2. There are two argument in the method "invoke(object obj, object[] obj)" in package "Method".
I have no idea about the second parameter "object[] obj ".what is mean ?
I pass " null " value to it and it works.But i pass anothers ,jvm will throw exception.I have a generic Method Executer that has a method like
public Object execute(String className, String methodName, Object args)
String fullClassName = packageName + className ;
Class delegateClass = Class.forName(fullClassName);
BaseDelegate delegate = (BaseDelegate)delegateClass.newInstance();
Method method = null;
if (args == null)
method = delegateClass.getMethod(methodName, new Class[] {});
obj = method.invoke(delegate,new Object[] {});
else
method = delegateClass.getMethod(methodName, new Class[] {args.getClass()});
obj = method.invoke(delegate, new Object[]{args});
}This seems to have problems when I call the method from a class like:
execute("CategoryDelegate", "getCategoryById", new Integer(4144));(I get a NoSuchMethodException)
The method I am trying to execute in CategoryDelegate looks like:
public Category getCategoryById(int categoryId) throws DelegateExceptionI think it has to deal with the difference in the way we handle Primitive Wrappers and Objects. Wrapper we have to use Interger.TYPE and with the rest of the Objects we have to use obj.class.
Am I doing something wrong here? Any suggestions to make it work for primitive wrappers as well as Objects? -
UI Error 'Method clone not found in class java.lang.Class'
When attempting to view an application window in the User Interface error I receive the error 'Method clone not found in class java.lang.Class'. The window will run correctly when I execute the application and other objects on the window are displayed correctly in the UI editor.
Within the window class I have used the following line of code to clone a reference list of values that is loaded just once when the application starts up: -
dsDefaultComboBoxModel priorityComboBoxModel = (dsDefaultComboBoxModel) dsReferenceLuLists.priorityComboBoxModel.clone();
And then this line of code to create a combo box: -
dsGuiComboBoxRefelu priorityComboBox = new dsGuiComboBoxRefelu(priorityComboBoxModel,ReportWindowSql.priorityCodeBuffer);
And then later on the combo box is displayed.
detailsArea.add(priorityComboBox, new XYConstraints(250,10,dsGlobalVariables.gvFieldWidthLarge,-1));
'dsDefaultComboBoxModel' is defined as follows: -
public class dsDefaultComboBoxModel extends DefaultComboBoxModel implements Cloneable
public dsDefaultComboBoxModel()
public Object clone()
try
return super.clone();
catch ( CloneNotSupportedException e )
// Shouldn't happen.
throw new InternalError( e.toString() );
This error occurs using the latest v903, but was also present in previous versions of JDeveloper.
At the moment this means that I did to execute the window in order to see all of the GUI elements that are displayed. As on option I could use something other than the clone method, but it seems to be such a nice way of copying the static reference lists.
Thanks for any help.Hi Darren,
My guess is that since DefaultComboBoxModel doesn't implement Cloneable, you can't call super.clone(). Does your code compile?
Later.
Dennis -
NullPointerException at java.lang.Class.forNameImpl(Native Method)
Hi All,
We installed an enterprise application using Websphere Application Server 6.1 and we use Java 1.5.0_18. We encountered the following error while testing the application:
[6/07/09 18:32:56:825 EST] 0000002b SystemErr R java.lang.NullPointerException
[6/07/09 18:32:56:825 EST] 0000002b SystemErr R at java.lang.Class.forNameImpl(Native Method)
[6/07/09 18:32:56:825 EST] 0000002b SystemErr R at java.lang.Class.forName(Class.java:130)
<the remaining part of the stack trace has been removed as it contains the names of our application specific classes>
Could you please let me know the root cause of this error?
Thank you.
Regards,
VenkateshI would double- and triple-check that. A null classname string is almost certainly the cause here.
-
How to call a java program in javafx class(Urgent) and even vice versa
Hi all,
Here I have two questions:
1)
Please let me know how to call a javafx in java program...
I tried with the following code but it is not working..
The below is the java program in which I made a call to the Fx program.
FxMainLauncher.java
import net.java.javafx.FXShell;
public class FxMainLauncher {
public static void main(String[] args) throws Exception {
FXShell.main(new String[] {"HelloWorld.fx"});
2) How to call a java program in javafx class
Here is my javafx program
import check.*;
import javafx.ui.*
var instance = new MyJava();
//visible:true
System.out.println("Number is: {instance}");
Here is my java program
public class MyJava {
public static void main(String args[])
System.out.println("JAVAFX TO JAVA");
Even this is not working please let me know ASAP
Thanks in advance,
V.SrilakshmiGOT IT !!!
I had to change the name of the method in .h file generated by javah command. On doing
javac -d ../../classes HelloWorld.java
go to the ../../classes directory (where you have the class file) and do
javah HelloWorld
I got a HelloWorld.h file in which I had
JNIEXPORT void JNICALL Java_HelloWorld_display(JNIEnv *, jobject);
I added the package name too:
JNIEXPORT void JNICALL Java_GUI_HelloWorld_display(JNIEnv *, jobject);
The HelloWorldImp.c file should have the same name (ie with package) and be in the same directory(ie ../../classes)
compile and build the shared library to get "libhello.so" file
gcc -c -fPIC -I/usr/lib/j2sdk1.3/include -I/usr/lib/j2sdk1.3/include/linux HelloWorldImp.c
gives .o file
gcc -shared -o libhello.so HelloWorldImp.o
gives .so file
then run java with the command in my first message. It works.
Thanks for the reply "thedracle". -
Urgent help needed(java frames)
Hi,
I need urgent help for correcting a piece of code.
I have written a piece of code for building a gui with some buttons, drawing some geometric shapes.The code consists of two files called Graph and Frame.
The problem I suppose in the last part of the Graph file, which Rectangle and Circle are called together, the only shape that the program draws is rectangle.Here is the code:
//Graph
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import java.util.*;
public class Graph extends JPanel {
LinkedList color;
LinkedList figures;
public Graph() {
setBackground(Color.white);
figures = new LinkedList();
color = new LinkedList();
int z;
class Point {
int x;
int y;
public Point(int x, int y) {
this.x = x;
this.y = y;
public Point(Point p) {
x = p.x;
y = p.y;
public String toString() {
return "(" + x + ", " + y + ")";
public void move(Point dist) {
x += dist.x;
y += dist.y;
abstract class GeomFigur {
public abstract void move(Point p);
class Line extends GeomFigur {
Point p1, p2;
public Line(Point p1, Point p2) {
this.p1 = new Point(p1);
this.p2 = new Point(p2);
public String toString() { return "Line from " + p1 + " to " + p2; }
public void move(Point dist) {
p1.move(dist);
p2.move(dist);
class Rectangle extends Line {
public Rectangle(Point p1, Point p2) {
super(p1, p2);
public String toString() { return "Rectangle from " + p1 + " to " + p2; }
class Circle extends GeomFigur{
Point centre;
int radius;
public Circle(Point centre, int radius) {
this.centre = new Point(centre);
this.radius = radius;
public String toString() {
return "Circle, centre " + centre + ", radius " + radius;
public void move(Point dist) { centre.move(dist); }
public void addRectangle(int x, int y, Color col) {
Rectangle r =new Rectangle(new Point(x,y),new Point(x+20,y+20));
figures.addLast(r);
color.addLast(col);
repaint();
public void addCircle(int x, int y, Color col) {
Circle c =new Circle(new Point(x,y), 1 );
figures.addLast(c);
color.addLast(col);
repaint();
public void paintComponent(Graphics g) {
super.paintComponent(g);
for (int i=0;i < figures.size();i++) {
Rectangle rect = (Rectangle)figures.get(i);
//Circle circ = (Circle)figures.get(i);
g.setColor(Color.black);
g.drawRect(rect.p1.x,rect.p1.y,20,20);
g.setColor((Color)color.get(i));
g.fillRect(rect.p1.x,rect.p1.y,20,20);
//g.setColor(Color.black);
// g.drawOval(circ.centre.x,circ.centre.y,20,20);
// g.setColor((Color)color.get(i));
// g.fillOval(circ.centre.x, circ.centre.y, 20, 20);
//Frame
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class Frame extends JFrame implements ActionListener {
JButton button1, button2, button3, button4, button5 ;
Graph gr;
JComboBox cbx;
JComboBox cby;
JComboBox col;
JMenu filemenu;
JMenuItem quit;
JMenuBar menubar;
int x=10;
int y=10;
Color color=Color.red;
public Frame() {
menubar = new JMenuBar();
filemenu = new JMenu("File");
filemenu.setMnemonic('F');
quit = new JMenuItem("Quit");
quit.addActionListener(this);
quit.setMnemonic('Q');
quit.setAccelerator(KeyStroke.getKeyStroke('Q',Event.CTRL_MASK,false));
filemenu.add(quit);
menubar.add(filemenu);
setJMenuBar(menubar);
button1 = new JButton("Rectangle");
button1.addActionListener(this);
button2 = new JButton("Circle");
button2.addActionListener(this);
button4 = new JButton("Ellipse");
button4.addActionListener(this);
button5 = new JButton("Triangle");
button5.addActionListener(this);
button3 = new JButton("Reset");
button3.addActionListener(this);
String[] elements_x= {"10","20","30","40","50","60","70"};
cbx = new JComboBox(elements_x);
cbx.addActionListener(this);
cbx.setActionCommand("cbx");
String[] elements_y= {"10","20","30","40","50","60","70"};
cby = new JComboBox(elements_y);
cby.addActionListener(this);
cby.setActionCommand("cby");
String[] elements_color = {"Red","Blue","Green","Orange","Yellow" };
col = new JComboBox(elements_color);
col.addActionListener(this);
col.setActionCommand("col");
gr = new Graph();
JPanel top = new JPanel(new BorderLayout());
JPanel inputs = new JPanel(new GridLayout(6,1));
inputs.add(button1);
inputs.add(button2);
inputs.add(button3);
inputs.add(button4);
inputs.add(button5);
inputs.add(cbx);
inputs.add(cby);
inputs.add(col);
top.add(gr,BorderLayout.CENTER);
top.add(inputs,BorderLayout.WEST);
getContentPane().add(BorderLayout.CENTER, top);
setSize(500,300);//set window size
//take care of actions
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if (command.equals("Quit")){
System.exit(0);//terminate program
else if (command.equals("Rectangle")){
//add Rectangle to graph at
//position x,y and with certain color
gr.addRectangle(x,y,color);
else if (command.equals("Circle")){
gr.addCircle(x,y,color);
else if (command.equals("Reset")){
else if (command.equals("Triangle")){
else if (command.equals("Ellipse")){
else if (command.equals("cbx")){
x=Integer.valueOf((String)((JComboBox)e.getSource()).getSelectedItem()).intValue();
else if (command.equals("cby")){
y=Integer.valueOf((String)((JComboBox)e.getSource()).getSelectedItem()).intValue();
else if (command.equals("col")){
String temp=(String)((JComboBox)e.getSource()).getSelectedItem();
if (temp=="Red") color=Color.red;
else if (temp=="Blue") color=Color.blue;
else if (temp=="Green") color=Color.green;
else if (temp=="pink") color=Color.pink;
else if (temp=="lightGray") color=Color.lightGray;
//main program
public static void main(String [] args) {
Frame appl = new Frame();
appl.setVisible(true);
Thanks in advance
MarinaHi,
You are very lucky that I'm currently boored. You should never tag a question as urgent. It might be urgent to you, but not to us who answer. And you should also use code formatting when you post code (see the formatting tips, or use the code-button).
I made some changes to your Graph class. The most important thing is the abstract draw method that I added to the GeomFigur class.
import java.awt.*;
import javax.swing.*;
import java.util.*;
public class Graph extends JPanel {
LinkedList figures;
public Graph() {
setBackground(Color.white);
figures = new LinkedList();
int z;
abstract class GeomFigur {
protected Color color;
public GeomFigur(Color color) {
this.color = color;
public abstract void move(Point p);
public abstract void draw(Graphics g);
abstract class Line extends GeomFigur {
Point p1, p2;
public Line(Color c, Point p1, Point p2) {
super(c);
this.p1 = new Point(p1);
this.p2 = new Point(p2);
public String toString() {
return "Line from " + p1 + " to " + p2;
public void move(Point dist) {
p1.move(dist.x, dist.y);
p2.move(dist.x, dist.y);
class Rectangle extends Line {
public Rectangle(Color c, Point p1, Point p2) {
super(c, p1, p2);
public String toString() {
return "Rectangle from " + p1 + " to " + p2;
public void draw(Graphics g) {
System.out.println("Draw rectangle at " + p1 + " with color " + color);
g.setColor(Color.black);
g.drawRect(p1.x, p1.y, 20, 20);
g.setColor(color);
g.fillRect(p1.x, p1.y, 20, 20);
class Circle extends GeomFigur {
Point centre;
int radius;
public Circle(Color c, Point centre, int radius) {
super(c);
this.centre = new Point(centre);
this.radius = radius;
public String toString() {
return "Circle, centre " + centre + ", radius " + radius;
public void move(Point dist) {
centre.move(dist.x, dist.y);
public void draw(Graphics g) {
System.out.println("Draw circle at " + centre + " with color " + color);
g.setColor(Color.black);
g.drawOval(centre.x, centre.y, 20, 20);
g.setColor(color);
g.fillOval(centre.x, centre.y, 20, 20);
public void addRectangle(int x, int y, Color col) {
System.out.println("x,y,col " + x + ":" + y + ":" + col);
Rectangle r = new Rectangle(col, new Point(x, y), new Point(x + 20, y + 20));
figures.addLast(r);
repaint();
public void addCircle(int x, int y, Color col) {
System.out.println("x,y,col" + x + ":" + y + ":" + col);
Circle c = new Circle(col, new Point(x, y), 1);
figures.addLast(c);
repaint();
public void paintComponent(Graphics g) {
super.paintComponent(g);
for (int i = 0; i < figures.size(); i++) {
GeomFigur drawable = (GeomFigur)figures.get(i);
drawable.draw(g);
}/Kaj -
Java.rmi.UnmarshalException: skeleton class not found but required for clie
Hello everyone,
I am new to RMI and getting a strange exception. I am using Java 1.5.0_07 both on client and server. They are running on the same machine, the rmi registry is started inside the server application.
I am wondering why java complains about skeletons, I thought they are automatically created when using java 5.0?
Please have a look at the stacktrace below.
Thank you for your help.
Best Regards
Patric
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
java.rmi.UnmarshalException: skeleton class not found but required for client version
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
sun.rmi.transport.Transport$1.run(Transport.java:153)
java.security.AccessController.doPrivileged(Native Method)
sun.rmi.transport.Transport.serviceCall(Transport.java:149)
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
java.lang.Thread.run(Thread.java:595)
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
java.rmi.Naming.lookup(Naming.java:84)
org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)The full class path information that I can gather is as follows (some of the library path locations could be suspect...):
Class path: /edge/node3/hotfix::/edge/node3/current/lib/JMdsApi.jar:/edge/node3/current/lib/MemoryProfilingAgent.jar:/edge/node3/current/lib/T2common-2.6.0-SNAPSHOT.3200.jar:/edge/node3/current/lib/T2scripting-jython.jar:/edge/node3/current/lib/activation.jar:/edge/node3/current/lib/alib.jar:/edge/node3/current/lib/alibom.jar:/edge/node3/current/lib/ant.jar:/edge/node3/current/lib/authapi.jar:/edge/node3/current/lib/bbdlapi.jar:/edge/node3/current/lib/bcpg-jdk15-136.jar:/edge/node3/current/lib/bcprov-jdk15-136.jar:/edge/node3/current/lib/c3p0-0.9.1.2.jar:/edge/node3/current/lib/castor-1.1-codegen-anttask.jar:/edge/node3/current/lib/castor-1.1-codegen.jar:/edge/node3/current/lib/castor-1.1-xml.jar:/edge/node3/current/lib/castor-1.1.jar:/edge/node3/current/lib/colt-1.2.0.jar:/edge/node3/current/lib/common-annotations.jar:/edge/node3/current/lib/commons-beanutils.jar:/edge/node3/current/lib/commons-codec-1.3.jar:/edge/node3/current/lib/commons-collections-3.2.1.jar:/edge/node3/current/lib/commons-jexl-1.1.jar:/edge/node3/current/lib/commons-lang-2.3.jar:/edge/node3/current/lib/commons-logging-1.1.1.jar:/edge/node3/current/lib/commons-net-1.4.1.jar:/edge/node3/current/lib/dsn.jar:/edge/node3/current/lib/eagleapi.jar:/edge/node3/current/lib/ezmorph-1.0.3.jar:/edge/node3/current/lib/f2-loader-1.8.jar:/edge/node3/current/lib/fasttrade-boviewer-1.0.1.jar:/edge/node3/current/lib/hsqldb.jar:/edge/node3/current/lib/icu4j-3.4.4.jar:/edge/node3/current/lib/ivy.jar:/edge/node3/current/lib/janino.jar:/edge/node3/current/lib/janus-sdk-1.7.0.0.jar:/edge/node3/current/lib/jasypt-1.4.1.jar:/edge/node3/current/lib/javolution.jar:/edge/node3/current/lib/jcalendar-1.3.2.jar:/edge/node3/current/lib/jcl-over-slf4j-1.5.6.jar:/edge/node3/current/lib/jcommon-1.0.9.jar:/edge/node3/current/lib/jconn2.jar:/edge/node3/current/lib/jconn3-6.05-b26214.jar:/edge/node3/current/lib/jdom.jar:/edge/node3/current/lib/jfreechart-1.0.5.jar:/edge/node3/current/lib/jgroups-all.jar:/edge/node3/current/lib/jline.jar:/edge/node3/current/lib/jmkv123p1.jar:/edge/node3/current/lib/jna.jar:/edge/node3/current/lib/joda-time-1.5.2.jar:/edge/node3/current/lib/jscience.jar:/edge/node3/current/lib/json-lib-2.2.1-jdk15.jar:/edge/node3/current/lib/jul-to-slf4j-1.5.6.jar:/edge/node3/current/lib/junit.jar:/edge/node3/current/lib/jython.jar:/edge/node3/current/lib/log4j-1.2.15.jar:/edge/node3/current/lib/log4j-over-slf4j-1.5.6.jar:/edge/node3/current/lib/loggablePreparedStatement-1.6.jar:/edge/node3/current/lib/looks-2.1.4.jar:/edge/node3/current/lib/mailapi.jar:/edge/node3/current/lib/model-12021.jar:/edge/node3/current/lib/mysql-connector-java-5.1.7-bin.jar:/edge/node3/current/lib/opencsv-1.8.jar:/edge/node3/current/lib/rfa.jar:/edge/node3/current/lib/rspcore.jar:/edge/node3/current/lib/slf4j-api-1.5.6.jar:/edge/node3/current/lib/slf4j-log4j12-1.5.6.jar:/edge/node3/current/lib/smtp.jar:/edge/node3/current/lib/smtphandler-0.6.jar:/edge/node3/current/lib/spring-2.5.2.jar:/edge/node3/current/lib/statsvn.jar:/edge/node3/current/lib/swingx-0.9.3.jar:/edge/node3/current/lib/t2-12021.jar:/edge/node3/current/lib/testng-5.9-jdk15.jar:/edge/node3/current/lib/tibmsg.jar:/edge/node3/current/lib/tibrvj.jar:/edge/node3/current/lib/trove.jar:/edge/node3/current/lib/velocity-tools.jar:/edge/node3/current/lib/velocity.jar:/edge/node3/current/lib/xalan.jar:/edge/node3/current/lib/xerces.jar:/edge/node3/current/lib/patng/activeio-core-3.0.0-incubator.jar:/edge/node3/current/lib/patng/activemq-core-4.1.1.jar:/edge/node3/current/lib/patng/avalon-framework-4.1.3.jar:/edge/node3/current/lib/patng/backport-util-concurrent-2.2.jar:/edge/node3/current/lib/patng/binding-1.4.0.jar:/edge/node3/current/lib/patng/cglib-nodep-2.1_3.jar:/edge/node3/current/lib/patng/common-1.30.jar:/edge/node3/current/lib/patng/commons-cli-1.0.jar:/edge/node3/current/lib/patng/commons-configuration-1.2.jar:/edge/node3/current/lib/patng/commons-discovery-0.2.jar:/edge/node3/current/lib/patng/commons-math-1.1.jar:/edge/node3/current/lib/patng/concurrent-1.3.4.jar:/edge/node3/current/lib/patng/geronimo-j2ee-management_1.0_spec-1.0.jar:/edge/node3/current/lib/patng/geronimo-jms_1.1_spec-1.0.jar:/edge/node3/current/lib/patng/logkit-1.0.1.jar:/edge/node3/current/lib/patng/mina-core-1.0.1.jar:/edge/node3/current/lib/patng/mina-filter-ssl-1.0.1.jar:/edge/node3/current/lib/patng/mina-java5-1.0.1.jar:/edge/node3/current/lib/patng/mx4j-remote-3.0.1.jar:/edge/node3/current/lib/patng/mx4j-tools-3.0.1.jar:/edge/node3/current/lib/patng/org.apache.felix.framework-1.0.0.jar:/edge/node3/current/lib/patng/org.osgi.core-1.0.0.jar:/edge/node3/current/lib/patng/pat-dt-common-1.18.jar:/edge/node3/current/lib/patng/pat-sdt-1.18.jar:/edge/node3/current/lib/patng/patNg-api-1.27.1.jar:/edge/node3/current/lib/patng/patNg-server-aoc-1.21.jar:/edge/node3/current/lib/patng/patNg-server-common-1.21.jar:/edge/node3/current/lib/patng/patNg-server-session-manager-1.21.jar:/edge/node3/current/lib/patng/patNg-utils-1.27.1.jar:/edge/node3/current/lib/patng/qpid-broker-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-client-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-common-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-mina-core-2.2.2.0.jar:/edge/node3/current/lib/patng/rsee-2.11.jar:/edge/node3/current/lib/patng/servlet-api-2.3.jar:/edge/node3/current/lib/patng/silk-1.3.jar:/edge/node3/current/lib/patng/slf4j-api-1.4.0.jar:/edge/node3/current/lib/patng/slf4j-log4j12-1.4.0.jar:/edge/node3/current/lib/patng/validation-1.2.0.jar
Boot class path: /apps/jdk/1.6.0_13/linux/jre/lib/resources.jar:/apps/jdk/1.6.0_13/linux/jre/lib/rt.jar:/apps/jdk/1.6.0_13/linux/jre/lib/sunrsasign.jar:/apps/jdk/1.6.0_13/linux/jre/lib/jsse.jar:/apps/jdk/1.6.0_13/linux/jre/lib/jce.jar:/apps/jdk/1.6.0_13/linux/jre/lib/charsets.jar:/apps/jdk/1.6.0_13/linux/jre/classes:/tmp/yjp200811122006.jar
Library path: /apps/jdk/1.6.0_13/linux/jre/lib/i386/server:/apps/jdk/1.6.0_13/linux/jre/lib/i386:/apps/jdk/1.6.0_13/linux/jre/../lib/i386::/edge/node3/current/lib:/home/eqdev/eqedgeuat/yourkit_7_5_11/yjp-7.5.11/bin/linux-x86-32:/edge/node3/current/lib:/home/eqdev/eqedgeuat/yourkit_7_5_11/yjp-7.5.11/bin/linux-x86-32:/usr/java/packages/lib/i386:/lib:/usr/lib -
Java Applets and multiple classes not working.
I have tested my JApplet class alone to view its layout and to make sure it actually works. But once I add in my other classes, compile, jar, and test I get the error:
java.lang.NoClassDefFoundError: AlakApp (wrong name: alak/codeFiles/AlakApp)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:155)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:127)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:618)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:779)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:708)
at sun.applet.AppletPanel.run(AppletPanel.java:362)
at java.lang.Thread.run(Thread.java:619)My Directory contains these and only these:
F:\alak\codeFiles:
AlakApp.java
Game.java
Board.java
Space.java
index.html
AlakGame.jarAll my classes are in the package alak.codeFiles.
My .html file contains this:
<HTML>
<HEAD>
<TITLE>ALAK</TITLE>
</HEAD>
<BODY>
<applet code="AlakApp.class" archive="AlakGame.jar" width=400 height=200>
Please use a Java compatible browser to see this.
</applet>
<br>
</BODY>
</HTML>These are they commands I am issuing:
F:\alak\codeFiles>javac *.java
F:\alak\codeFiles>jar -cvf AlakGame.jar *.class
F:\alak\codeFiles>appletviewer index.htmlI've been trying many different things to narrow down what is going on. If you need to see my code let me know, but I've tested everything with a text-based user interface and they work.
So does anyone know the cause of this error?Ok i rared the test and uploaded to rapidshare.. here is the link:
http://rapidshare.com/files/76860865/test.rar.html
But here is the code. They are in the directory /test/files/
ADigit.java
package test.files;
public class ADigit
private int value;
public ADigit( int val )
this.value = val;
public String toString()
return "" + this.value;
}ADigitApp.java
package test.files;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ADigitApp extends JApplet implements ActionListener
private ADigit numeroUno;
private int currentNum;
private Container container;
private javax.swing.JLabel jLabel;
private javax.swing.JTextArea jTextArea;
private javax.swing.JButton jButton;
public void init()
currentNum = 1;
numeroUno = new ADigit( currentNum );
container = getContentPane();
container.setLayout( new BorderLayout() );
jLabel = new javax.swing.JLabel();
jTextArea = new javax.swing.JTextArea();
jLabel.setText( "The Number is: " );
jTextArea.setText( numeroUno.toString() );
jButton = new javax.swing.JButton();
jButton.setText( "New Number" );
jButton.addActionListener( this );
container.add( jLabel, BorderLayout.WEST );
container.add( jTextArea, BorderLayout.CENTER );
container.add( jButton, BorderLayout.EAST );
setSize( 200, 200 );
public void actionPerformed( ActionEvent e )
this.currentNum++;
numeroUno = new ADigit( this.currentNum );
jTextArea.setText( numeroUno.toString() );
}index.html
<HTML>
<HEAD>
<TITLE>NUMBERSSSS</TITLE>
</HEAD>
<BODY>
<applet code="ADigitApp.class" archive="NumberFun.jar" width=200 height=200>
Please use a Java compatible browser to see this.
</applet>
<br>
</BODY>
</HTML>Commands:
/test/files>javac *.java
/test/files>jar -cvf NumberFun.jar *.class
/test/files>appletviewer index.htmlThis example produces the same style of error.
Maybe you are looking for
-
War files and server classpath on 6.1
We used to have all of the jsp's and html exploded in a WebApp and the WebApp just used the same classes and property files the server was using, now we put all these files in a war file. My question is do I have to take
-
I got a new iPad how do I get my photos onto it from my Old iPad
I got the new iPad I currently have the iPad 1 before that I cannot figure out how to get my Photos from my old iPad to my new iPad please help
-
Undelete a deleted PO item line10
I want to undelete a deleted PO. I am using ME22N select a line item but the delete symbol is in display mode. I have to undelete a line item. Please help...
-
How do I correct 'Time Machine couldn't complete the backup to "Time Capsule" because "-.sparsebundle" is already in use'?.
-
Update pivot table cell then refresh
I want to update my pivot table that connects to my SQL2008R2 AS. The requirement is to update the ship date with cuurent date then refresh all Tabs with WorkBook. Here is my code that doesn't allow me to update the cell. The xcel version is 2003. $