AddItemListener() for array of checkboxes

I'm new to interface design and believe this to be how to add an item listener to an Array of JcheckBoxes, Java has other ideas, could anybody show me where i am going wrong.
The error reported is in the for loop, line 3 of the code below:
//Register a listener for the check boxes.
        for (int i=0; i<numberOfDrugs; i++){
     drugCheck.addItemListener(this);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
/** Listens to the check boxes. */
public void itemStateChanged(ItemEvent e){
Object source = e.getItemSelectable();
for (int i =0; i<numberOfDrugs; i++){
     if (source == drugCheck) {
     if (drugCheck[i].isSelected() == true){
     drugsSelected+=1;
     drugEffectiveness[i].setEnabled(true);
     drugCumDosage[i].setEnabled(true);
     else {
     drugsSelected-=1;
     drugEffectiveness[i].setEnabled(false);
     drugCumDosage[i].setEnabled(false);

Checkboxes are created thus:
JCheckBox[] drugCheck = new JCheckBox[numberOfDrugs];
//Creates 'numberOfDrugs' amount of checkboxes
for (int i=0; i<numberOfDrugs; i++){
             drugCheck[i] = new JCheckBox("checkbox" + i);
     getContentPane().add(drugCheck);
The error message reads as below:
d:\documents\== project ==>javac gui/*.java
gui/A.java:78: addItemListener(java.awt.event.ItemListener) in javax.swing.AbstractButton cannot be applied to (gui.A)
drugCheck[i].addItemListener(this);
So i would go along with the THIS part not being an item listener, which is where the problem lies.

Similar Messages

  • Storing an array of checkbox booleans into preferences and retrieving them

    Just wondering how to go about storing an array of JCheckBoxes into a preference and retrieving it. There's 32 checkboxes so if they select, say, 6 of these randomly it should store it in a preference file and retrieve it when the application is loaded so that the same 6 checkboxes remain selected. I'm currently getting a stack overflow error, though.
    import java.util.prefs.*;
    public class Prefs {
         Preferences p;
         GUI g = new GUI();
         public Prefs() {
              p = Preferences.userNodeForPackage(getClass());
              g = new GUI();
         public void storePrefs() {
              for (int i = 0; i < g.symptoms.length; i++) {
                   p.putBoolean("symptoms", g.symptoms.isSelected());
         public void retrievePrefs() {
              for (int t = 0; t < g.symptoms.length; t++) {
                   p.getBoolean("symptoms", g.symptoms[t].isSelected());
    symptoms is the array of checkboxes in the GUI class. Not sure where I am going wrong here. I can do it with strings from textfields etc but this is proving to be an annoyance. :(
    Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Actually, I have a better example, see below
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.util.prefs.*;
    public class PreferencesTest {
        private Preferences prefs;
        public static final String PREF_OPTION = "SELECTED_MENU_ITEM";
        public void createGui() {
            prefs = Preferences.userNodeForPackage(this.getClass());
            JMenuItem exitAndCloseMenuItem = new JMenuItem("Exit");
            exitAndCloseMenuItem.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent e) {
                    System.exit(0);
            JMenu fileMenu = new JMenu("File");
            fileMenu.add(exitAndCloseMenuItem);
            JCheckBoxMenuItem[] preferenceItems = {
                new JCheckBoxMenuItem("pref 1"),
                new JCheckBoxMenuItem("pref 2"),
                new JCheckBoxMenuItem("pref 3"),
                new JCheckBoxMenuItem("pref 4")};
            int selectedMenuItem = prefs.getInt(PREF_OPTION, 0);
            preferenceItems[selectedMenuItem].setSelected(true);
            ButtonGroup preferencesGroup = new ButtonGroup();
            JMenu preferenceMenu = new JMenu("Preferences");
            for(int i = 0;i<preferenceItems.length;i++){
                preferenceItems.setActionCommand(Integer.toString(i));
    preferenceItems[i].addActionListener(new menuItemActionListener());
    preferencesGroup.add(preferenceItems[i]);
    preferenceMenu.add(preferenceItems[i]);
    JMenuBar menuBar = new JMenuBar();
    menuBar.add(fileMenu);
    menuBar.add(preferenceMenu);
    JFrame f = new JFrame("Prefernce Test");
    f.setJMenuBar(menuBar);
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    public static void main(String[] args){
    new PreferencesTest().createGui();
    class menuItemActionListener implements ActionListener{
    public void actionPerformed(ActionEvent e) {
    JCheckBoxMenuItem jcbm = (JCheckBoxMenuItem)e.getSource();
    prefs.put(PREF_OPTION, jcbm.getActionCommand());

  • Enter event not triggering for read-only checkbox

    I have some objects in a form that get "locked" when the user signs the form.  I'm not using the digital signatures.  Instead, when the user types their name into the signature text field, a script runs on the change event that makes all of the fields in the form read only.  It also unlocks the fields if the signature is deleted.
    I was worried that we would get a lot of phone calls with users that didn't understand that the form had locked ("Why doesn't this form work?!"), so I added some code to the enter event for all of the fields that would pop up a messagebox to explain to people trying to edit a signed form that the form was locked and that they would need to delete the signature to edit the form.
    This plan works perfect for my text fields and decimal fields.  It does NOT work at all for my checkboxes.  For some reason, the enter event is never triggered for read-only checkboxes.  I don't see any other events that would obviously work for me though.  Any ideas?
    Thanks

    Thanks, those are reasonable suggestions.
    In the first suggestion, I'm unclear about one aspect of how I would accomplish this.  I assume I would allow people to modify fields in the form, but that when they did, a msgbox would pop up that would inform them that, if they continued with this modification to a signed form, the signature would be removed.  I'm all good to that point.  But if they answered that they do not want to continue modifying that field and removing the signature, how can I code it to set the value back to what it was before the change?  Is there some method that will give me access to the value of the field BEFORE the attempted modification?  I went looking for something like $.previousvalue, but found nothing.
    I'd suggest that I could use a two-stage solution, in which I store the previous value on the enter event, and save it just in case they do not want to change the field when prompted by the msgbox, but since the enter event does not exist for checkboxes (my original problem), that seems like it won't work.
    As far as radio button suggestion, I like radio buttons very much except for one fatal flaw: they aren't (as far as I can tell) clearable.  That is a shame.  Clearly some people (like me) want both exclusivity AND clearability.  And we'd like the controls to have an enter event.  But I know I'm demanding   Anyway, as it is, I just end up having to use checkboxes and create a boatload of silly code to make them exclusive.
    Emily

  • Need help for array counting

    Any help for array question
    Hello to All:
    I want to tally or count some of the elements that I have in array but not sure how.
    I have for example: int myArray[] = {90,93,80,81,71,72,73,74};My objective is to tally all of the 90's, tally all of the 80's and tally all of the 70's.
    So, the result that I want to have would look something like the following:
    System.out.println ("The total tally number of 90's is " 2 );
    System.out.println ("The total tally number of 80's is " 2 );
    System.out.println ("The total tally number of 70's is " 4 );I do not want to add these numbers, just want to count them.
    Also I want to use a "forloop" to achieve the result intead of just declaring it at 2 or 4 etc..
    Any help Thankyou

    [u]First , This is not exactly what I have to
    do for homework. There is a lot more, a lot more
    involved with the program that I am working on.
    Second, this is an example, an example, an
    example of something that I need to achieve.
    Third, you are asking for a code, to me that
    sounds as if your asking for homework. Fourth,
    I did not ask for any rude comments. Fith, in
    the future please do not reply to my messages at ALL
    if you can not help!!!!
    Sixth, We did not ask for lazy goofs to post here.
    Seventh, In the future please do not post here. Take a hike - there's the virtual door.

  • Deserializer not found for array Type...

    I hava a web-Servicd deployed in AXIS - is Takes an array of a complex type and returns one.
    Everytime i run the service the service properly does the processing and returns the correct Object.
    When the client receives the REsponse i get the following exception
    - Exception:
    org.xml.sax.SAXException: No deserializer defined for array type {urn:SchufaService}Response
         at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:304)
         at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:428)
         at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:976)
         at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
         at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722)
         at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
         at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
         at org.apache.axis.client.Call.invoke(Call.java:2272)
         at org.apache.axis.client.Call.invoke(Call.java:2171)
         at org.apache.axis.client.Call.invoke(Call.java:1691)
         at de.awe.client.SchufaServiceSoapBindingStub.getInformation(SchufaServiceSoapBindingStub.java:329)
         at de.awe.client.SessionClient.main(SessionClient.java:45)here is my .wsdd file - i think i did the correct bean and type mappings:
    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
                xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    <handler name="session" type="java:org.apache.axis.handlers.SimpleSessionHandler">
    </handler>
    <service name="SchufaService" provider="java:RPC">
      <requestFlow>
           <handler type="soapmonitor"/>
        <handler type="session"/>
      </requestFlow>
      <responseFlow>
           <handler type="session"/>
        <handler type="soapmonitor"/>
      </responseFlow>
      <parameter name="scope" value="session"/>
      <parameter name="className" value="de.awe.webservice.SchufaService"/>
      <parameter name="allowedMethods" value="*"/>
      <beanMapping qname="SchufaService:Person" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Person"/>
      <beanMapping qname="SchufaService:Address" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Address"/>
      <beanMapping qname="SchufaService:Request" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Request"/>
      <beanMapping qname="SchufaService:Response" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.xml.Response"/>
      <beanMapping qname="SchufaService:ResponseAuskunft" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.xml.ResponseAuskunft"/>
      <beanMapping qname="SchufaService:ResponseFehlerbehandlung" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.xml.ResponseFehlerbehandlung"/>
      <beanMapping qname="SchufaService:ResponseNachbehandlung" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.xml.ResponseNachbehandlung"/>
      <beanMapping qname="SchufaService:Textdaten" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Textdaten"/>
      <beanMapping qname="SchufaService:Merkmal" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Merkmal"/>
      <typeMapping
            xmlns:ns="http://localhost:8080/axis/services/SchufaService"
            qname="ns:ArrayOf_tns1_Request"
            type="java:de.awe.client.Request[]"
            serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
            deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          />
      <typeMapping
            xmlns:ns="http://localhost:8080/axis/services/SchufaService"
            qname="ns:ArrayOf_tns1_Response"
            type="java:de.awe.client.Response[]"
            serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
            deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          />
    </service>
    </deployment>Please tell me where to find the error...
    Thanks a lot

    Hi,
    Can you paste the client's code in here? this error is usually on the client side where in the array type was not mapped properly.
    thanks,
    leighsy
    I hava a web-Servicd deployed in AXIS - is Takes an
    array of a complex type and returns one.
    Everytime i run the service the service properly does
    the processing and returns the correct Object.
    When the client receives the REsponse i get the
    following exception

  • User event for array of waveforms with attribute

    I have been transferring data in a Producer/Consumer architecture via User Events.  The data consisted of an array of waveforms. When I added an attribute to the waveforms the code breaks with two errors about Create User Event: User event data type is unnamed or has elements with no names or duplicate names, and Contains unwired or bad terminal.
    From reading the help on user events it is not clear that arrays are even allowed: "user event data type is a cluster of elements or an individual element whose data type and label define the data type and name of the user event."
    From experimentation it seems that arrays of numerics and arrays of wavefroms without attributes work. A single waveform with an attribute can also be used. But an array of the same waveform with attribute leads to a broken run arrow. It also appears that I can put the array of waveforms with attributes inside a cluster and then create the user event.
    Is this a bug, an undocumented corner case, or some "feature" that I do not understand?
    Searching for User Event for Array of Waveforms generates some interesting, but mostly irrelevant results.
    Lynn

    tst wrote:
    Another option would be typecasting, but it looks like you can't typecast a waveform. Variant to Data or Coerce to Type might also work, but I haven't tried.
    I have also done the Flatten To String and Unflatten From String to send data around.  It would be preferable to not need to do that though.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • ODI-40406: Bytes are too big for array error

    Hello ,
    I am trying to load a flat file from a table. I am working on ODI 11G.
    Following are performed.
    Staging area different from SOurce is checked.
    IKM used is : IKM SQL to File Append
    Truncate is True
    No LKM is used.
    I am getting following error:
    java.lang.IllegalArgumentException: ODI-40406: Bytes are too big for array
    create header (RECORDTYPE,
    ASSIGN_NUM,
    USR_ID,
    START_TIME,
    JOBCODEID,
    AISLE_AREA_ID,
    PLANE_DATE,
    CLIENT_ID,
    CSTNUM,
    WH_ID)
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=UNITIME TO RPSNP$CRLOAD_FILE=C:\Program Files\ODI_BI_APPS/UNITIME TO RP.txtSNP$CRFILE_FORMAT=FSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP

    There is a possibility of mismatch of datatype, that can cause the problem.
    Say in ODI model, you have defined a 'Date type' field to be stored as 'String' however at the time of mapping in 'Interface', no conversion happens (from date to string)  for this particular object. This causes the problem.
    The original query remains valid at DB side (fires for datetype) however fails while integrating (anticipating String which may be longer than defined in modelbecause of your NLS setting in DB). Therefore the best way would be to apply conversion for that particular field (in this case, use TO_CHAR(Date type,'Desired Date Format').

  • ODI-40406: Bytes are too big for array

    I am getting the following error: java.lang.IllegalArgumentException: ODI-40406: Bytes are too big for array
    I am trying to a file to file mapping and all of my columns match in size. Does anyone have any ideas what this problem could be? I am getting an error when it tries to perform an integration step while trying to create the target table. I am assuming it is something wrong with one of my datastores
    Edited by: 897642 on Nov 16, 2011 5:19 PM

    There is a possibility of mismatch of datatype, that can cause the problem.
    Say in ODI model, you have defined a 'Date type' field to be stored as 'String' however at the time of mapping in 'Interface', no conversion happens (from date to string)  for this particular object. This causes the problem.
    The original query remains valid at DB side (fires for datetype) however fails while integrating. Therefore the best way would be to apply conversion for that particular field (in this case, use TO_CHAR(Date type,'Desired Date Format').

  • 'Incorrect value type for array element in index N'

    Please help.  Preflight is flagging multiple 'Incorrect value type for array element in index N" > Required key /F is missing >Array element at index 0 is of wrong type' messages for pages throughout my text document with embedded navigation and annotations.What does it mean? Is there anything I can do?
    The origins of the file are from a selection of emails taken from Mail and gmail, and letters probably written on pc (Office) and converted to pdf...
    I'm on Mac Mavericks.
    Thanks for reading.

    What problem are you trying to solve with preflighting? What are you checking for?

  • Index data types for Arrays

    Is Java still limited to no long integers for index values?
    If you know, what is the reason for that limit? Thanks in advance.

    Only asked if index values were still limited to int.
    In other words, is long now allowed or not?No, long is not allowed. Only unsigned int is allowed. This means your arrays are limited to 2 billion elements. So if you have the 64-bit version of Java and more than 64 GB of memory, this might be of concern. If not int, should be fine.
    I realize that indexes have to be positive. That was
    not the question. There doesn't seem to be any good
    reason for limiting index values to a little over 2
    trillion however absurdly large that might seem to2 billion. 2^31, because this is the size of an int, The limit could have been mad eto be long but this would have wasted memory for every array, to allow a limit which is still not possible except with the largest computers. Even, then there is no current practice use for such a large array.
    most. And I realize that most of the time it will not be an issue.Not even of use.
    To answer my own question, I wrote a simple program
    defining an index value as long in a "for"
    statement's initialization and when I tried to
    compile it I got the error message, "found : long /
    required: int" (using JCreator with most recent
    version of JDK. Perhaps long was not the best choise. Try int for a loop counter.
    In addition to int, I found that "byte" and "short"
    work. I was amused to find that "char" also works.These can all be converted to int without loosing precision.
    Of course, "boolean", "float" and "double" do not work. And "long" does not work.These cannot be converted to int as simply.
    So, clearly the limit against using long still exists, but why?You have to pick a limit. Why make long a limit when BigInteger could be used for arrays larger than 2^63 elements.
    So my question is simply: Why does this limit still exist? Is there some "problem" that is being avoided? If so, what?Because there is no practical use for an array larger than 2 biilion elements.
    Unless you have the 64-bit version of the JDK, you could would hit an address limit in any case.

  • How to search for array in another array ?

    i want to search for array in another and when i got this array i want to take the next 5 bits  EX: array1 [ 4 8 7] , array2 [ 9 1 4 8 7 6 3 2 ] , output array [ 6 3 2 9 1]
    Thanks  

    I know we should be encouraging others to help them selves, but I had a solution that I think is what the user wants.  Attached is a VI that searches for a subarray in an array, and will return the index it is found at.  It will also return the input array, filtered if a match is found.  This VI just handles the double data type.
    Most of the code comes from an old post by Altenbach that I can't seem to find at the moment, but I saved a copy a while ago.  Props to him for posting it.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    Filter Subarray - DBL.vi ‏18 KB

  • Terminal images for arrays on block diagram

    I had always know that the thickness of the wire is representative of the size of the array on the block diagram (Thin wire, scalar, thicker wires, larger dimension arrays)
    I never noticed before that the terminal on the block diagram contained the [ ] symbols to indicate it is an array.  But also, the larger the dimension of the array, the thicker the brackets are, up to about 5-D.  (Probably because I rarely need a 3-D array, and large than isn't any practical, logical reason for a 4-D or larger array.)
    However, looking at the image of the terminal, the shaded area containing the outgoing or incoming triangle actually obscures one bracket or the other.
    While I wouldn't want the terminal to get any larger (which is why I don't like the icon view, it is way too large), it seems like the terminal should show both the opening and closing brackets to indicate an array rather than obscuring one.
    Any comments?
    Message Edited by Ravens Fan on 08-22-2009 12:59 AM
    Attachments:
    Example_VI_BD.png ‏3 KB

    Definitely keep the arrows. They are what tell me the direction of the terminals.
    As I was saying in another post, there is nothing intuitive about the thick border/thin border differences to tell whether the terminal is a source or sink. I like that they are a bit different, but if you put them side by side with no wires and no arrows, I couldn't tell you which was which.
    As for array size, as Christian says, if I want to know the type/dimensions of the array, I'll use context help. I just thought it was interesting (and I had never noticed it before) that the array size was encoded in the image as well.
    I myself wouldn't mind if the terminal grew 2 or 4 pixels wider, but I can completely understand how it would bother a lot of people.
    I think in the current image, too much is obscured by the arrow and its background, even for the scalar type. Actually, why is there a light background behind the arrow at all. That is the real source of the problem. Eliminate the background, and move the arrow over to the edge, and you can see everything without extra shading and without causing the terminal to grow.
    See below:
    1. Terminal size maintained.
    2. Direction arrow maintained, just slightly moved.
    3. Goofy shaded background removed.
    Message Edited by Ravens Fan on 08-22-2009 09:48 PM
    Attachments:
    terminals3.png ‏5 KB

  • TestStand Data Type Enumeration Explained for Array of column_information

    I'm sure it's in the documentation somewhere but I can't find TestStand Data Type Enumeration Explained for Array of column_information.
    data_type 1, 2, 3 ect.
    What do they represent?
    Thnaks,
    -SS
    Attachments:
    TestStand.PNG ‏20 KB

    If you are referring to the Database Connectivity Toolkit, then the definitions for the data types are as follows:
    Item
    Value
    String
    0
    Long (I32)
    1
    Single (SGL)
    2
    Double (DBL)
    3
    Date/Time
    4
    Binary
    5
    Jared A.
    Applications Engineer
    National Instruments

  • [svn:fx-trunk] 12788: By popular demand, we now allow for empty child property tags for Array type properties.

    Revision: 12788
    Revision: 12788
    Author:   [email protected]
    Date:     2009-12-10 07:46:54 -0800 (Thu, 10 Dec 2009)
    Log Message:
    By popular demand, we now allow for empty child property tags for Array type properties. Coerced to empty array '[]'.
    QE notes: None
    Doc notes: None
    Bugs: SDK-24500
    Reviewer: Paul
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24500
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AbstractBuilder.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav a

    Hi John,
    Sorry to tell but tab completion is still failing on my Windows XP/Indesign CS5 (caught by Indesign).
    I just saw your remark on coloring text, here is an example pulled out from Peter's book "ScriptUI for dummies":
    var w = new Window ("dialog");
    var s = w.add ("statictext", undefined, "Static");
    var e = w.add ("edittext", undefined, "Edit");
    var b = w.add ("button", undefined, "Button");
    // The window's backround
    w.graphics.backgroundColor = w.graphics.newBrush (w.graphics.BrushType.SOLID_COLOR, [0.5, 0.0, 0.0]);
    // Font and its colour for the first item, statictext
    s.graphics.font = ScriptUI.newFont ("Helvetica", "Bold", 30);
    s.graphics.foregroundColor = s.graphics.newPen (w.graphics.PenType.SOLID_COLOR, [0.7, 0.7, 0.7], 1);
    // Font and colours for the second item, edittext
    e.graphics.font = ScriptUI.newFont ("Letter Gothic Std", "Bold", 30);
    e.graphics.foregroundColor = e.graphics.newPen (e.graphics.PenType.SOLID_COLOR, [1, 0, 0], 1);
    e.graphics.backgroundColor = e.graphics.newBrush (e.graphics.BrushType.SOLID_COLOR, [0.5, 0.5, 0.5]);
    // Font for the tird control, a button. Can't set colours in buttons
    b.graphics.font = ScriptUI.newFont ("Minion Pro", "Italic", 30);
    w.show ();
    Loic

  • Receiving modi Event for Arrays

    Hi, is their a way to receive modificationEvents for arrays?
    i currently get accessEvent on int[], but i need to get modificationEvent on the values of the arrays i.e. (int type) array[0] = 25, array[1] = 30.
    The excludes for the debugger are String[] excludes = {
                   "java.*",
                   "javax.*",
                   "sun.*",
                   "com.sun.*"
    When i get a classPrepareEvent, i create a modification and access watchpoint for each field for that class and then use the classExclusionFilter using the excludes above, then enable, the request.
    here's the debuggee code:
    public class Obj
         public int x;
         public int[] array;
    public Obj()
         array = new int[10];
         array[0] = 25;
         array[1] = 30;
    Here's the events i receive:
    EVENT: null
    EVENT: class prepare request (enabled)
    EVENT: method entry request (enabled)
    EVENT: method entry request (enabled)
    EVENT: modification watchpoint request Obj.array (enabled)
    EVENT: access watchpoint request Obj.array (enabled)
    EVENT: access watchpoint request Obj.array (enabled)
    EVENT: method exit request (enabled)
    EVENT: method exit request (enabled)
    EVENT: thread death request (enabled)
    but after the access event on array[0] = 25; i shoudl get a modification event
    The only way i found of recording the changes in the array, is keeping the old value from the accessEvent, then the next event (after the access, which coudl be anything, methodExit/entry, field modi), check to see which value is different then show that value in my trace. But this is totally not a good idea.
    Currently my trace looks like this:
    main Obj
    | <init> Obj(ID=272)
    //| | values = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    | | array = instance of int[10] (id=273) UID= 272
    | | Access Field = array Value = instance of int[10] (id=273)
    | | Access Field = array Value = instance of int[10] (id=273)
    ===== main end =====
    i should really have:
    main Obj
    | <init> Obj(ID=272)
    //| | values = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    | | array = instance of int[10] (id=273) UID= 272
    | | Access Field = array Value = instance of int[10] (id=273)
    | | array[0] = 25
    | | Access Field = array Value = instance of int[10] (id=273)
    | | array[1] = 30
    ===== main end =====
    thanks

    Does anyone have any ideas how i can receive ModificationEvents for adding values to arrays?? Really need some help with this. I did try with Vector by including it with the classes to fire events but when the add method was invoked, it called other methods as well and messed the trace up. Add() method also calls ensureCapacityHelp() for Vector as well but i jsut want to see the add() method in my trace.

Maybe you are looking for

  • I want to change my Apple ID on my device to my new ID but the device would not allow me to do that! how do I?

    I have acquired a used iPhone. I want to set it up as my own. I want to change my Apple ID in the iCloud Settings og the phone to include my new ID but the iPhone is stuck on the previous one even though the phone has been dereigistered fom the old u

  • Why can't yellow box appear on year beyond 2 years?

    I create many events in 2014 in iCal. When I select list, it show only up to 2 years?  Same thing with yellow box mark on each month didn't show beyond 2 years. Is there I can set up?

  • Using a view-object as a data web bean?

    Hi, When writing JSP pages, I'd like to have a web bean that allows basic data manipulation such as: - set up a row set - e.g. by specifying a view object and an (optional) where clause; - navigate this row set (first, next, etc.); - get or set the v

  • Success with 1.B0 BIOS update

    With my K8N Neo2 Platinum board I have just flashed the BIOS from 1.A to 1.B0 sucessfully and it has enabled the USB v.2.0 ports.  I only had USB v.1.1 before. I am a happy camper.

  • Error in connecting to DB

    I have a Oracle 10g database to be connected to. Through sql plus, I can connect to it using the following command sqlplus "sys@pmi as sysdba"and password is 'password' how do I connect to this db through my Java code? I tried _connection = DriverMan