How to make a Exception class in java ?

I want to make a class called SomeException. I want to throw this exception from my class Myclass. How to do it ??

Just let SomeException extend Exception (or RuntimeException) and throw it the same way you'd throw any other exception. There's no magic involved.

Similar Messages

  • How to make a oval shape in java

    how to make an oval shape in java

    here's a simple example:
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.Color;
    /* <applet code="OvalTest" width=83 height=43></applet> */
    public class OvalTest extends Applet {
         public void init() {
              setBackground(Color.white);
         public void paint(Graphics g) {
              g.setColor(Color.blue);
              g.fillOval(1,1,80,40);
    }

  • How to make a net browser using java

    We want to make an MultiLingual Explorer in JAVA .So please help me in the case thatfirst i want to do the coding of the basic interface as the menu option like open,save,save As etc.So how can i start it in java.Is their any builtin support or what is the best possible ways.I sahll appreciate the cooperation....
    Kindly help me out....
    (As i am a student and new in java so plz guide me thoroughly)
    Thanx

    There have been java browsers that have been developed + this is well-documented (at least in one or two texts i've read, i assume on-line too), but they're quite complex + i doubt if someone new to java would be able to customise it without a brain haemorrhage. Tough call!

  • How to make a .exe from a java .class

    Hi All,
    I want to write a scheduler program in Java and that class file I want to install as a service in windows scheduler. So for that purposr I need an executale right?
    How can I convert a java class to a .exe program.
    Thanks and Regards
    KK

    No need to create exe file. U can covert into .bat file. With help of windows scheduler u can run the file as per ur required.

  • How to get user defined class in java client of a bpel prcoess?

    I have written a simple bpel process which returns a bean class namely employee which has three String fields(name,id and email). From java client when I am invoking the prcoess the prcoess instance is starting and completing properly. From Bpel console when I check the audit of the instance, it shows everything as expected. But in client class instead of three strings I am getting only first string i.e email in response. I checked the mapping and all WSDL files but could not find a proper reason. I am attaching the wsdls of bpel prcoess and the client code:
    BPELProcess5.wsdl
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="BPELProcess5"
    targetNamespace="http://xmlns.oracle.com/BPELProcess5"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:client="http://xmlns.oracle.com/BPELProcess5"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:sq="http://xmlns.oracle.com/BPELProcess5/bean">
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         TYPE DEFINITION - List of services participating in this BPEL process
         The default output of the BPEL designer uses strings as input and
         output to the BPEL Process. But you can define or import any XML
         Schema type and us them as part of the message types.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <types>
    <schema attributeFormDefault="qualified"
                   elementFormDefault="qualified"
                   targetNamespace="http://xmlns.oracle.com/BPELProcess5/bean"
                   xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="employeetype" >
    <all>
    <element name="fname" type="string"/>
    <element name="lname" type="string"/>
    <element name="id" type="string"/>
         </all>
    </complexType>
    </schema>
              <schema attributeFormDefault="qualified"
                   elementFormDefault="qualified"
                   targetNamespace="http://xmlns.oracle.com/BPELProcess5"
                   xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://xmlns.oracle.com/BPELProcess5/bean"/>
                   <element name="BPELProcess5ProcessRequest">
                        <complexType >
                             <sequence>
                                  <element name="input" type="string"/>
                             </sequence>
                        </complexType>
                   </element>
    <!--
                   <element name="BPELProcess5ProcessResponse">               
    <complexType >
                             <sequence>
                                  <element name="output" type="sq:employeetype"/>
                             </sequence>
                        </complexType>
                   </element>
    -->
              </schema>
         </types>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         MESSAGE TYPE DEFINITION - Definition of the message types used as
         part of the port type defintions
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <message name="BPELProcess5RequestMessage">
              <part name="payload" element="client:BPELProcess5ProcessRequest"/>
         </message>
         <message name="BPELProcess5ResponseMessage">
              <part name="payload" type="sq:employeetype"/>
         </message>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PORT TYPE DEFINITION - A port type groups a set of operations into
         a logical service unit.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <!-- portType implemented by the BPELProcess5 BPEL process -->
         <portType name="BPELProcess5">
              <operation name="process">
                   <input message="client:BPELProcess5RequestMessage" />
                   <output message="client:BPELProcess5ResponseMessage"/>
              </operation>
         </portType>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PARTNER LINK TYPE DEFINITION
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <plnk:partnerLinkType name="BPELProcess5">
              <plnk:role name="BPELProcess5Provider">
                   <plnk:portType name="client:BPELProcess5"/>
              </plnk:role>
         </plnk:partnerLinkType>
    </definitions>
    BPELPrcoess5.bpel
    // Oracle JDeveloper BPEL Designer
    // Created: Thu Jul 14 16:50:15 IST 2005
    // Author: Arka
    // Purpose: Synchronous BPEL Process
    -->
    <process name="BPELProcess5" targetNamespace="http://xmlns.oracle.com/BPELProcess5" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:ns1="http://demows/handler/SessionEJB.wsdl" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xmlns.oracle.com/BPELProcess5/bean" xmlns:client="http://xmlns.oracle.com/BPELProcess5" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"><!-- ================================================================= --><!-- PARTNERLINKS --><!-- List of services participating in this BPEL process --><!-- ================================================================= -->
    <partnerLinks><!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:BPELProcess5" myRole="BPELProcess5Provider"/>
    <partnerLink myRole="SessionEJBPortType_Role" name="PartnerLink_1" partnerRole="SessionEJBPortType_Role" partnerLinkType="ns1:SessionEJBPortType_PL"/>
    </partnerLinks><!-- ================================================================= --><!-- VARIABLES --><!-- List of messages and XML documents used within this BPEL process --><!-- ================================================================= -->
    <variables><!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="client:BPELProcess5RequestMessage"/><!--
    Reference to the message that will be returned to the requester
    -->
    <variable name="outputVariable" messageType="client:BPELProcess5ResponseMessage"/>
    <variable name="Invoke_1_getEmployee_InputVariable" messageType="ns1:getEmployee1Request"/>
    <variable name="Invoke_1_getEmployee_OutputVariable" messageType="ns1:getEmployee1Response"/>
    </variables><!-- ================================================================= --><!-- ORCHESTRATION LOGIC --><!-- Set of activities coordinating the flow of messages across the --><!-- services integrated within this business process --><!-- ================================================================= -->
    <sequence name="main"><!-- Receive input from requestor.
    Note: This maps to operation defined in BPELProcess5.wsdl
    -->
    <receive name="receiveInput" partnerLink="client" portType="client:BPELProcess5" operation="process" variable="inputVariable" createInstance="yes"/><!-- Generate reply to synchronous request -->
    <assign name="Assign_1">
    <copy>
    <from variable="inputVariable" part="payload" query="/client:BPELProcess5ProcessRequest/client:input"/>
    <to variable="Invoke_1_getEmployee_InputVariable" part="empid"/>
    </copy>
    </assign>
    <invoke name="Invoke_1" partnerLink="PartnerLink_1" portType="ns1:SessionEJBPortType" operation="getEmployee" inputVariable="Invoke_1_getEmployee_InputVariable" outputVariable="Invoke_1_getEmployee_OutputVariable"/>
    <assign name="Assign_2">
    <copy>
    <from variable="Invoke_1_getEmployee_OutputVariable" part="return" query="/return/fname"/>
    <to variable="outputVariable" part="payload" query="/payload/ns2:fname"/>
    </copy>
    <copy>
    <from variable="Invoke_1_getEmployee_OutputVariable" part="return" query="/return/lname"/>
    <to variable="outputVariable" part="payload" query="/payload/ns2:lname"/>
    </copy>
    <copy>
    <from variable="Invoke_1_getEmployee_OutputVariable" part="return" query="/return/id"/>
    <to variable="outputVariable" part="payload" query="/payload/ns2:id"/>
    </copy>
    </assign>
    <reply name="replyOutput" partnerLink="client" portType="client:BPELProcess5" operation="process" variable="outputVariable"/>
    </sequence>
    </process>
    myClient.java
    package mypackage2;
    import bean.EmployeeBean;
    import java.rmi.RemoteException;
    import java.util.ArrayList;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.JAXRPCException;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.ServiceException;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.encoding.XMLType;
    import javax.xml.rpc.soap.SOAPFaultException;
    import org.apache.axis.Constants;
    import org.apache.axis.client.Call;
    public class myClient
    private static QName SERVICE_NAME;
    private static QName PORT_TYPE;
    private static QName OPERATION_NAME;
    private static String SOAP_ACTION;
    private static String STYLE;
    private static String THIS_NAMESPACE = "http://xmlns.oracle.com/BPELProcess5";
    private static String PARAMETER_NAMESPACE = "http://xmlns.oracle.com/BPELProcess5";
    private String location;
    static
    SERVICE_NAME = new QName(THIS_NAMESPACE,"BPELProcess5");
    PORT_TYPE = new QName(THIS_NAMESPACE,"BPELProcess5") ;
    OPERATION_NAME = new QName(THIS_NAMESPACE,"BPELProcess5ProcessRequest");
    SOAP_ACTION = "process";
    STYLE = "wrapped";
    public myClient()
    public void setLocation(String location)
    this.location = location;
    public void initiate(String symbol)
    try
    DeserializerImpl des = new DeserializerImpl();
    ServiceFactory serviceFactory = ServiceFactory.newInstance();
    Service service = serviceFactory.createService( SERVICE_NAME );
    Call call = (Call)service.createCall( PORT_TYPE );
    call.setTargetEndpointAddress( location );
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, SOAP_ACTION);
    call.setOperationName(OPERATION_NAME);
    call.addParameter(new QName(PARAMETER_NAMESPACE,"input"), XMLType.XSD_STRING, ParameterMode.IN);
    Object[] params = new Object[1];
    params[0] = "1";
    call.setReturnType(new QName("http://xmlns.oracle.com/BPELProcess5", "BPELProcess5ProcessResponse"), EmployeeBean.class);
    EmployeeBean response = (EmployeeBean)call.invoke(params);
    System.out.println( " BPEL process initiated" );
    catch (SOAPFaultException e)
    System.err.println("Generated fault: ");
    System.out.println (" Fault Code = " + e.getFaultCode());
    System.out.println (" Fault String = " + e.getFaultString());
    catch (JAXRPCException e)
    System.err.println("JAXRPC Exception: " + e.getMessage());
    catch (ServiceException e)
    System.err.println("Service Exception: " + e.getMessage());
    catch(RemoteException e)
    System.err.println("Remote Exception: " + e.getMessage());
    public static void main(String[] args)
    String location = "http://localhost:9700/orabpel/default/BPELProcess5/1.0";
    myClient client = new myClient();
         client.setLocation( location );
    client.initiate( "" );
    }

    Hi Abdul,
    From the document, we know that CONSTRAINED flag is used to reduce the risk of injection attacks via the specified string. If a string is provided that is not directly resolvable to qualified
    or unqualified member names, the following error appears: "The restrictions imposed by the CONSTRAINED flag in the STRTOSET function were violated."
    So you need to make sure the members are passed properly to the STRTOSET function. For more details, please see the following links:
    http://ch1n2.wordpress.com/2010/02/21/the-restrictions-imposed-by-the-constrained-flag-in-the-strtoset-function-were-violated/
    http://www.bp-msbi.com/2010/04/passing-unconstrained-set-and-member-parameters-between-reports-in-reporting-services/
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Don't know how to make my main class import a jar file

    OK, the title doesn't make much sense but here are my create-jar.bat and manifest files:
    create-jar.bat:
    jar cvmf manifest.txt dassimul-admin.jar player/ admin/ com/ connector/ common/ *.class
    manifest.txt:
    Main-Class: admin.DASAdmin
    the problem is that in connector/ folder there is the jdbc mysql connector driver (.jar file).
    in Eclipse I can add this jar to the Java Build Path, so the program runs.
    When I double-click the dassimul-admin.jar file, I get a Class Not Found Exception
    C:\MYWORK\dassimul>java -jar dassimul-admin.jar
    FATAL ERROR WHILE LOADING SQL DRIVER: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I think that the problem lies in the fact that admin.DASAdmin can't see and import the jar file in connector/ folder... am I right?

    It looks like you are putting the mysql jar file inside the dassimul jar. That won't work unless you write custom code. You should use the Class-Path attribute of the manifest to define a relative path(s) to the other jar(s) that you need to use.
    [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]

  • How To Make A File Splitter In Java

    Hey everyone...is it possible to make a file splitter program in java swing?what API do you think should be used in creating that application and how does it work? Assume that the application will be ran on windows desktop. Thanks to all...

    * FileSplitter.java
    import java.util.*;
    public class FileSplitter {
        ArrayList list = new ArrayList();{
            list.add("test 01");
            list.add("test 02");
            list.add("test 03");
            list.add("test 04");
            list.add("test 05");
            list.add("test 06");
            list.add("test 07");
            list.add("test 08");
            list.add("test 09");
            list.add("test 10");
            list.add("test 11");
            list.add("test 12");
            list.add("test 13");
            list.add("test 14");
            list.add("test 15");
            list.add("test 16");
            list.add("test 17");
            list.add("test 18");
            list.add("test 19");
            list.add("test 20");
            list.add("test 21");
            list.add("test 22");
            list.add("test 23");
            list.add("test 24");
            list.add("test 25");
            list.add("test 26");
            list.add("test 27");
            list.add("test 28");
            list.add("test 29");
            list.add("test 30");
        public FileSplitter() {
            testAlgorithm();
        private void testAlgorithm(){
            final int randNo = list.size()/2;//=number of input records / 2
            Random r = new Random();         //creates a new random number generator
            List newlist = new ArrayList();  //constructs a new empty list
            while(list.size()> randNo) {//returns true if the number of elements in the list is greater than randNo
                //(half of the input records are splitted)
                int index = r.nextInt(list.size());//returns a random between 0 (inclusive)
                //and the number of elements in the list (exclusive)
                newlist.add(list.get(index));//returns the element at the specified position in the list
                //and appends it to the end of newlist
                list.remove(index);//removes the element at the specified position in the list
                //and shifts any subsequent elements to the left
            System.out.println("newlist: "+newlist);//one part of the file
            System.out.println("list: "+list);//the other part of throws file
        public static void main(String[] args) {
            new FileSplitter();
    }

  • How to make file associations in my java apps

    I am making a Graph maker in Java. Just give x = 1,2,3,4,5 and corresponding y = f(x) and get the discreate graph.
    The graph can then be saved as a file of extention .grf (say) on the hard disk, and can be opened in my graph maker software for editing, viewing e.t.c.
    Now my problem is that I want that when I dubble click on a file xyz.grf my graph maker should open automatically with this file opened in it, like other applications on windows say Notepad - dubble click on xyz.txt it will automatically launch Notepade with this file.
    In other way I want that any .grf file gets associated to my graf maker.
    Please help me and tell me the way, how should I proceed and how can I do this.

    aashishjava wrote:
    Yes Yes Yes It is 99% what I wanted to have. Thanks a lot ....You're welcome.
    But now I want some thing more,(hand to forehead) They always want more. ;)
    (a) There is a splash screen in my app. but JNLP always show its own splash screen, ...Webstart splash screens work differently to those of plain Jar files (which is unfortunate). A webstart splash screen has to be not included in the Jar, but available as a separate resource. The splash is defined in the JNLP launch file. For further details see the [JNLP File Syntax|http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/syntax.html].
    <quote>
    The optional kind="splash" attribute may be used in an icon element to indicate that the image is to be used as a "splash" screen during the launch of an application. If the JNLP file does not contain an icon element with a kind="splash" attribute, but does contain another icon tag, Java Web Start will display a splash screen consisting of the image specified by the icon element on the left and the application's title and vendor on the right.
    The first time an application is launched following the addition or modification of the icon element in the JNLP file, the old splash image will still be displayed. The new splash image will appear on the second and subsequent launches of the application.
    </quote>
    The 'ignored first time' is because the webstart client is more focused on getting the app. downloaded, cached and launched, than showing splashes. Once the app. is on-screen, it will download the splash in the background.
    One other 'gotcha' of splash screens is that the JNLP file must define a href in the JNLP element for the splash to be used. The webstart client assumes that a JNLP with no href is dynamically generated, and will not be the same twice. Because of that it ignores the splash!
    Edit 1:
    Unfortunately, I do not have any direct examples of using splash screens A splash is usually on my 'To Do' list for projects, but it is a very low priority.
    Edited by: AndrewThompson64 on Dec 10, 2009 11:35 AM

  • How to make a horizontal line in java html browser?? without hr

    I use java html browser
    I want to make a black horizontal line
    the <hr> line is not good
    for my customer it seems that there is a double spacing in this case
    I tried to write
    <td style = "BORDER-BOTTOM: 1px solid #000000"> ...
    but it does not work
    I suppose this style is not supported by the default StyleSheet
    I tried to write
    <td bgcolor="black" height=1>
    but the table has all rows with equal sizes
    therefore the real height is too big
    Please help me
    I tried to write
    <table border="1">... </table>
    even in this case I have table without any border

    Hi,
    the best way might be to use a blind table with all cells set to have a border on the bottom. The problem is that the standard Java runtime does not render such setting automatically. There is plenty of work involved to adapt it and still it then would work only in the adapted version and not the standard runtime environment.
    Anyway, you can find a working example of how to accomplish individual borders around table cells in open source application SimplyHTML at http://www.lightdev.com/dev/sh.htm
    Ulrich

  • How to make a WSDL file generate Java Code

    Hi, I'm quite new in web services. I used the ebay shopping service importing the WSDL file with wsimport, and NetBeans automagically created the Ebay libraries while parsing the WSDL.
    Now I'm trying to implement my own soap WS, i'm quite finished but when I try to use it importing the WSDL in a new project, my classes are not imported.
    So, where's the trick? How can I include code generationi n my WSDL?
    thanks in advance :)

    hi,
    since the wsdl parsing was complet, for sure the classes are copied (.java), to see them check the following path
    YourService\build\generated\wsimport\client\YourService
    and the .class file will be in
    YourService\build\generated\wsimport\binaries\YourService

  • How to make Visibroker's 'vbjc' use Java 1.3 by modifying the properties fi

    Hi,
    I am using Visibroker for java 4.0 to develop an application. The
    java version that I am using is 1.4.1. Now, the naming service does
    not start when I use 1.4.1. And I cannot do away with Java1.4.1
    because I am using certain classes in javax.crypto which does not
    exist at all in Java 1.3. I am left with the option of trying to
    configure the properties file of 'vbjc' in such a way that it uses
    Java 1.3 instead of 1.4. How can i do this? Can someone please help me
    out?
    Thanks in advance,
    Shankar.

    HI!
    you hasn't given more details ;
    can you send me the command, by which you r trying to start the Naming service.
    As well as send me the error that you are getting , when used jdk1.4.1

  • How CLOB Oracle maps to class in Java?

    How does CLOB data type
    of Oracle database table column
    maps to
    Java class
    of instance variable of EJB Bean class?
    For instance:
    In Oracle
    column BABUSHKA is of CLOB type
    in EJB bean class
    instance var baBushka is of ??????? class
    Can ???? be:
    java.lang.String
    java.sql.Somethingelse
    Viktor
    Please help - I'm on brink of bursting in tears!

    Hi,
    I do not believe CLOB is supported yet. JDBC 3.0, I think.
    I think you have to go through the same process as with BLOBs. I know this
    is how you would read them, but do not recall an InputStream method on the
    weblogic....OracleCLOB object.
    sorry could not help more.
    Slava
    "Viktor Gritsenko" <[email protected]> wrote in message
    news:8ists6$ptl$[email protected]..
    How does CLOB data type
    of Oracle database table column
    maps to
    Java class
    of instance variable of EJB Bean class?
    For instance:
    In Oracle
    column BABUSHKA is of CLOB type
    in EJB bean class
    instance var baBushka is of ??????? class
    Can ???? be:
    java.lang.String
    java.sql.Somethingelse
    Viktor
    Please help - I'm on brink of bursting in tears!

  • How to make a TicTacToe game in Java?

    My assignment requires me to make a java applet tic tac toe game. I have come as far as creating panels and adding 9 buttons to the center panel. The logic defeats me. I have looked around at the web for source code but everything looks fairly complicated. Here's what I have so far:
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class Homework5 extends Applet {
    Panel northPanel = new Panel();
    Panel southPanel = new Panel();
    Panel eastPanel = new Panel();
    Panel westPanel = new Panel();
    Panel mainPanel = new Panel();
    Button resetButton = new Button ("Tic Tac Toe");
    Button squares[];
    public void init() {
    setLayout(new BorderLayout());
    northPanel.setBackground(Color.orange);
    southPanel.setBackground(Color.orange);
    eastPanel.setBackground(Color.orange);
    westPanel.setBackground(Color.orange);
    mainPanel.setBackground(Color.orange);
    add("North", northPanel);
    add("South", southPanel);
    add("East", eastPanel);
    add("West", westPanel);
    add("Center", mainPanel);
    resetButton.setFont(new Font("Arial", Font.PLAIN, 12));
    northPanel.add(resetButton);
    mainPanel.setLayout(new GridLayout(3,3));
    squares = new Button[9];
    for ( int i = 0; i < 9; i++ ) {
    squares[i] = new Button();
    //squares.addActionListener(this);
    squares[i].setFont(new Font("Serif", Font.BOLD, 20));
    mainPanel.add(squares[i]);
    Can someone explain to me where I should go from here?
    Thanks.

    I figured it out. :-)
    I had to use 2 arrays (one to create the button and another to hold the X's and O's in memory). I also had to call on the getSource method for the values in my array. This is where I was getting stuck initially. 3 hours and 2 mountain dews later, I was all warm and fuzzy when it compiled without an error. :-)
    You can see it in action here:
    http://www.vnoel.com/pcc/cs162/applets/knarayan/homework5.html

  • How to deploy signed jars/classes in Java Stored Procedure

    I am using java encryption API in my java application that I want to deploy as java stored procedure. The API is kept in the signed jar files.
    The Application is running in the MS-DOS environment but not in Oracle8i.
    It gives me following error.
    java.lang.ExceptionInInitializerError: java.lang.SecurityException: Cannot set
    up certs for trusted CAs
    at javax.crypto.b.<clinit>([DashoPro-V1.2-120198])
    at javax.crypto.KeyGenerator.getInstance([DashoPro-V1.2-120198])
    at DesKey.GenerateKey(DesKey.java:63)
    declare
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.ExceptionInInitializerError
    ORA-06512: at line 4
    (Note: I have enabled the java output in SQL Plus editor otherwise it will give only the second part of error that starts from ERROR at line 1:)
    please guide me how to solve this problem.
    Salman Hameed
    null

    Salman,
    If you do not get a reply on this forum, I recommend you post this question on the Oracle JVM discussion forum as well.
    In addition, I would recommend checking the documentation for Oracle8i. The Oracle8i Java Developer's Guide, the Java Stored Procedures Guide, and the JDBC Developer's guide may have some information on this topic. You can get to this doc from the OTN Documentation page. Click on Oracle8i, then General Documentation, Release 2 (8.1.6), then scroll down to see the link for the Oracle8i Java Developer's documetation. All of the books mentioned above are available from that link.

  • Can we override Exception Class in Java ?

    I have done a project in structs 1.2 .
    I have used String variable without checking for null.
    so I get a null pointer exception.
    String str = null;
    str.equals("jayaraj"); //exception raised
    can i make a customized null pointer exception ?

    1) yes. NullPointerException isn't final, bizarrely
    2) why didn't you just try it?
    3) why the h3ll would you want to? is this a special kind of null or something??
    4) this isn't overriding. it's extending

Maybe you are looking for