Rollover PJC - Unable to reference String within mouseadapter

Hi
I am writing a PJC to colour the background of a text item on mouse rollover. The PJC extends VTextField and includes a nested mouseadapter class.
I would like a property, settable from the form, to determine whether the mouse rollover is enabled. The default behaviour should be rollover enabled.
To implement the behaviour of the property I have included a check on a string variable in the mouse adapter methods. If I don't set the property from the form the string is set to false. If I set the property using set_custom_property the string is set to the correct value.
How can I set the string to default to a value? It is declared as
String pEnabled = "YES";
I will post the full code

package pjcs.rolloverBackground;
//package totem.forms.extensions;
import java.awt.*;
import java.awt.event.*;
import java.util.StringTokenizer;
import oracle.forms.handler.IHandler;
import oracle.forms.properties.ID;
import oracle.forms.ui.VTextField;
public class rolloverBackground extends VTextField
     public static final ID propEnabled = ID.registerProperty("ENABLED");
public static final ID activeColor = ID.registerProperty("ACTIVE_COLOUR");
//private rolloverBackground this_item;
String pEnabled = "YES";
private Color pActiveColor;
private Color pNormalColor;
private boolean m_debug = true;
private boolean m_debugAll;
private final String CLASSNAME = this.getClass().getName();
private int iMode = 0 ;
private int iInc = 20 ;
     public rolloverBackground()
try
jbInit();
     catch(Exception e)
     e.printStackTrace();
     private void jbInit() throws Exception
     System.out.println("jb init 3 "+pEnabled);
     addMouseListener(new RolloverButtonMouseAdapter());
     * Private class to handle user mouse actions and to switch images when the
     * user moves the mouse into and out of the button object.
     class RolloverButtonMouseAdapter extends MouseAdapter
     * User moved the mouse over the button, swap to the on image.
     public void mouseEntered(MouseEvent me)
     //System.out.println("mouse entered "+this_item.getProperty(propEnabled).toString());
     System.out.println("mouse entered "+pEnabled);
if (pEnabled.equals("YES"))
     System.out.println("mouse entered 1" );
     pNormalColor = getBackground();
     if (iMode == 1)
     System.out.println("mouse entered 2.1 imode is 1 " );
     setBackground(pActiveColor);
     else if (iMode == 0)
     System.out.println("mouse entered 2.2 imode is 0 " );
     setBackground(getHighlight(getBackground()));
     * User moved the mouse out of the button, swap to the off image.
     public void mouseExited(MouseEvent me)
     // Change cursor back
     if (pEnabled.equals("YES"))
     setBackground(pNormalColor);
* set the properties of the bean
public boolean setProperty(ID property, Object value)
if (property == propEnabled)
pEnabled = value.toString();
return true;
else if (property == activeColor)
String s= value.toString();
int iR, iG, iB, ipos=-1 ;
ipos = s.indexOf(",") ;
if(ipos>-1)
System.out.println("SETHIGHLIGHT color:"+value.toString());
StringTokenizer st = new StringTokenizer(s,",");
iR = Integer.parseInt(st.nextToken()) ;
iG = Integer.parseInt(st.nextToken()) ;
iB = Integer.parseInt(st.nextToken()) ;
pActiveColor = new Color(iR,iG,iB) ;
iMode = 1 ;
else
System.out.println("SETHIGHLIGHT:"+value.toString());
if(s.indexOf("-")>-1) iInc = Integer.parseInt(s.substring(1)) * -1 ;
else iInc = Integer.parseInt(s.substring(1)) ;
iMode = 0 ;
return true;
else
return super.setProperty(property, value);
private Color getHighlight(Color c)
System.out.println("inc="+iInc);
int r,g,b ;
int iMax = ( iInc < 0 ? 0 : 255 ) ;
r = c.getRed() ;
g = c.getGreen();
b = c.getBlue() ;
r = (r+iInc >= iMax ? r+iInc : iMax) ;
g = (g+iInc >= iMax ? g+iInc : iMax) ;
b = (b+iInc >= iMax ? b+iInc : iMax) ;
return new Color(r,g,b);
}

Similar Messages

  • Reading String within the single quotes

    Hi All,
    Can you please let me know, how to read a String within the sinle quote in line.
    I have to read a report into internal table and again from that I need to read a string within the single quote. Please help me in this.
    Thanks in Advance,
    Raghu

    I have the following code:
    REPORT  test.
    DATA:  v_test(05) TYPE c.
    v_test = ‘TTT’.
    I am getting this errror:
    Field “TTT” is unknown.  It is neither kin on e of the specified tables nor defined by a “DATA” statement.
    For some reason, my single quote is not being recognized from my keyboard.  I noticed that my emotion icons are not being displayed either (example:  I type and i do NOT get the smiley face on my end).
    Is there a button that I pressed that caused that?

  • Replace String within a file

    i want to replace a string within a file
    there is NO GUI ..
    i take in mind two approaches
    1) hold the file content in memory
    and rewrite the file
    2) write the new data to a new file.
    and then rewrite the original file
    any better ideas

    sorry, no..
    Your idea is kinda right if small file is within existance..
    Small file.
    Why not just use the filereader and filewriter? read the docs upon that
    Large file
    Why wont you create a string buffer, and parse the file chunk by chunk into that buffer one at a time. Then of course you saved the position of the character or word you wanted to apend or write, and you just write it back to that area.

  • Using Excel Active X to Find a String within a column

    I am trying to use ActiveX functions to search for a string within a specific column in excel. And return the row index of that string if a match occurs. Any help on that will be appreciated. I used Read then Compare for each cell in that column, but it is too slow. Maybe a search will be faster.

    Here are some Vi's that will allow you to do a "find" just like doing the edit find function in excel. There is also a vi in there to do a search and replace.
    Joe.
    "NOTHING IS EVER EASY"
    Attachments:
    replace.llb ‏117 KB

  • Unable to reference Hibernate libraries in NW CE 7.1

    Hi,
    I am unable to reference Hibernate liberaries in NW CE 7.1. Though I have followed the steps mentioned in the some example (blog), still getting the same error.
    Can somebody help me if this is limitation or if I missed any setting.
    Thanks in advance
    Thanks,
    Prathap

    Hi Prathap and Richard!
    Look if the solution to my case can help you:
    Migrating to SAP Web AS - HibernateException: Errors in named queries
    Regards.
    Ballock.
    Edited by: Ballock on Aug 21, 2008 3:59 PM

  • How would I do a http post of the below listed XML string within a JSP?

    Hi,
    How would I do a http post of the below listed XML string within a JSP?
    <DoService xmlns="http://www.gdinrw.org/wss" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WSS" version="1.0">
    <ServiceRequest DCP="HTTP_POST" mimeType="text/xml" encoding="UTF-8"><![CDATA[REQUEST=GetCapabilities&SERVICE=WMS]]></ServiceRequest>
    <AuthMethod>urn:opengeospatial:authNMethod:OWS:1.0:password</AuthMethod>
    <Credentials>guest,guest</Credentials>
    <FacadeUrl>https://bern:8443/wss_umn_wms/WSS</FacadeUrl>
    </DoService>
    Thanks,
    John

    Yes,
    I need to set up data as POST format before I POST it.
    To be more specific I know how to post within a JSP if an xml element is like:
    <AuthMethod>urn:opengeospatial:authNMethod:OWS:1.0:password</AuthMethod>
    where the field is AuthMethod and the value is urn:opengeospatial:authNMethod:OWS:1.0:password
    but what I am not sure of is when the field has values embedded within it like:
    <ServiceRequest DCP="HTTP_POST" mimeType="text/xml" encoding="UTF-8"><![CDATA[REQUEST=GetCapabilities&SERVICE=WMS]]></ServiceRequest>:
    It has a field of ServiceRequest and a value of ![CDATA[REQUEST=GetCapabilities&SERVICE=WMS]]
    but it also other value embedded with ServiceRequest like mimeType="text/xml" .
    Thanks,
    John

  • Search for a String within a document (Word, txt, doc) using JSP, JAVA

    Hi
    I have created a little application that uses combination of JSP and HTML. Users of this application can upload documents which are then stored on the server. I need to develop functionality where I can allows users to search for a string within a document. More precisely, user would type in some string in a text box and application will search all uploaded documents for that string and return the downloadable links to those documents that contains that string. I have never done this before. I was wondering if someone could get me started on this or point me to some thread where this idea is already discussed. Any Jave code exists for searching through documents??
    Thanks for your help
    Riz

    http://www.ibm.com/developerworks/java/library/j-text-searching.html
    http://en.wikipedia.org/wiki/Full_text_search
    Type these parameter in yahoo:+efficient text search
    you will need something like openoffice library to read microsoft word document.

  • Rep-0002 : unable to retrive string from report builder message file

    rep-0002 : unable to retrive string from report builder message file
    i'm using developer/2000 ver 2.1 and my reports running under win95 platform and i'm using client/server techneque, when i start to distribute my reports to my users on their machines i got the above message , and i have to recompile all of my RDF files again on every user machine. this not all my story , but after some period may be 2 months these reports start to give the same message , again i must recompile all my RDF on every user machine.
    please if any one have a solution for this mazing problem.
    thank you.
    [email protected]

    bogdom and gaben,
    I belong to your club too it seems. Though in my case the compilation was required on each database. Report used to work in the only that database in which they were compiled. Connecting to other database used to give this string error. Moreover this problem existed only for those reports in which i had used PL/SQL code in the formula columns. One way to avoid this is by writing all PL/SQL code in a library and call it in the formula column calculations.
    null

  • UCCX: unable to convert string into a number

    Hi all,
    I used the Get Digit String to pull a 4 digital numbers (stored as variable sYear) from a caller, this number is obviously stored as a string. Then i used 'set iYear=sYear' to conver this string to an integer.
    I debuged the script, when I entered number of year without following #, it worked fine. If I entered number of year and followed by #, i got the message 'unable to conver string into a number'. Can someone help me with that?
    Thanks a lot.

    Hi Reena,
    The UCCX version is 10.5.1.
    I found the problem. It works after i changed input length to 5.  'The terminating key overrides the Maximum Input Length to terminate input'.
    Thanks.

  • Split Function unable to parse string correctly

    Hi,
    I'm using split function to split string into multiple rows using comma "," as delimiter. In a string I have following values which are not parsed correctly as they have comma inside the values. 
    American Dawn, Inc.
    Battalian USA, Inc.
    Fria USA, Inc.
    Lazer, Inc.
    Mexilink Inc.
    Is there any other approach to fix this issue?
    Here is the split function Im using:
    CREATE Function [dbo].[fnSplit] (
    @List varchar(MAX), 
    @Delimiter char(1)
    Returns @Temp1 Table (
    ItemId int Identity(1, 1) NOT NULL PRIMARY KEY , 
    Item varchar(MAX) NULL 
    As 
    Begin 
    Declare @item varchar(MAX), 
    @iPos int 
    Set @Delimiter = ISNULL(@Delimiter, ';' ) 
    Set @List = RTrim(LTrim(@List)) 
    -- check for final delimiter 
    If Right( @List, 1 ) <> @Delimiter -- append final
    delimiter 
    Select @List = @List + @Delimiter -- get position of
    first element 
    Select @iPos = Charindex( @Delimiter, @List, 1 ) 
    While @iPos > 0 
    Begin 
    -- get item 
    Select @item = LTrim( RTrim( Substring( @List, 1, @iPos
    -1 ) ) ) 
    If @@ERROR <> 0 Break -- remove item form list 
    Select @List = Substring( @List, @iPos + 1, Len(@List)
    - @iPos + 1 ) 
    If @@ERROR <> 0 Break -- insert item 
    Insert @Temp1 Values( @item ) If @@ERROR <> 0 Break 
    -- get position pf next item 
    Select @iPos = Charindex( @Delimiter, @List, 1 ) 
    If @@ERROR <> 0 Break 
    End 
    Return 
    End
    Another user in this forum posted a split function that
    he wrote:
    CREATE FUNCTION dbo.splitter(@string VARCHAR(MAX), @delim CHAR(1))
    RETURNS @result TABLE (id INT IDENTITY, value VARCHAR(MAX))
    AS
    BEGIN
    WHILE CHARINDEX(@delim,@string) > 0
    BEGIN
    INSERT INTO @result (value) VALUES (LEFT(@string,CHARINDEX(@delim,@string)-1))
    SET @string = RIGHT(@string,LEN(@string)-CHARINDEX(@delim,@string))
    END
    INSERT INTO @result (value) VALUES (@string)
    RETURN
    END
    GO
    Both of them are unable to parse above values incorrectly.
    FYI:  String is made of values that are selected
    by user in SSRS report. I think SSRS when combine values , put comma "," between multiple values.
    Any help or guidance would be appreciated.
    ZK

    duplicate of
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/820ac53c-ce25-4cc7-b828-5875a21d459d/split-function-unable-to-parse-string-correctly-in-ssrs-report?forum=sqlreportingservices
    please dont cross post
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Unable to use character within a String in a skeleton file

    The < character appears to be a special character to skeleton files. I am unable to use this character to built a string in a skeleton file.
    For instance, using this block:
    <jsp:scriptlet>
    String sample = "<test";
    </jsp:scriptlet>
    Results in this error: String literal is not properly closed by a double quote.
    It's also not allowed as a character either:
    <jsp:scriptlet>
    String sample = "[test";
    sample = sample.replace('[','<');
    </jsp:scriptlet>
    This block has the error: Invalid character constant.
    It appears the < character is a special character in the way skeleton files parse, but I can't find any way to escape it like normal special characters.

    That actually puts < into the string, which the browser won't interpret as HTML.
    This also breaks the Workshop UI saying the string literal isn't terminated. It doesn't like & or ; characters in strings either. However, it will still compile and run.
    Edited by btiminey at 01/31/2008 8:34 AM
    Edited by btiminey at 01/31/2008 8:35 AM

  • Entity Reference embedded within colspec attribute name-table col. heading

    My team is working on a project that involves converting MS Word documents to XML. The XML is applied to a stylesheet (*.xsl) which generates a *.pdf document. Is it valid to include an xml entity reference within a colspec attribute name? For example, the xml document would contain the following code for a table:
    <t id="t1109681052">TABLE 1.0 My Favorite Restaurants</t>
    <tbl id="tbl921133606" val="1.0">
    <TblHdg num="1">Table 1.0 My Favorite Restaurants </TblHdg>
    <colspec id="colspec1148420628" name=" Restaurant Name" width="0.61875"/>
    <colspec id="colspec201089067" name="Type of Authentic Cuisine" width="1.61875"/>
    <colspec id="colspec201089069" name="Location" width="1.61875"/>
    </tbl>
    Is the following code valid in XML to produce the results in the sample table below when the XML is applied to a stylesheet (xsl)?
    <colspec id="colspec201089067" name="Type of "Authentic" Cuisine" width="1.61875"/>
    The desired table and column titles would be as follows:
    Restaurant Name ----     Type of “Authentic” Cuisine ----     Location
    Le Chantecler --------------->French     The Negresco Hotel –
    Promenade des Anglais Nice France
    La Coupola -------------------->French     The Mirabeau Hotel
    1 Princess Grace Ave
    Monte Carlo Monaco
    What is needed in the XML code to produce the table column heading with quotes embedded around the word "Authentic"?
    Please advise. Thanks so much and have a prosperous and memorable holiday.

    SOLUTION RESOLVED FOR THIS MESSAGE.

  • Why am I unable to select layers within the layout window - PSE13

    I am working on a project in expert mode. It has several layers. Randomly, I am now unable to select any of the layers within the layout window. I have tried to drag or click on or over an element and nothing happens, it keeps selecting the same element unless I select it from the layers utility on the right hand side. I have tried this with a mouse and a Wacom tablet, same result.

    Fixed by running updates, resetting preferences and rebooting. Phew!

  • PJC tab-key navigation problem within bean  (FORMS intercepting tab key??)

    Using Forms 10.1.2.3, IE7, JRE 1.6
    When attempting to navigate within the bean area, it appears as if FORMS is suppressing the keyEvent when the tab key is pressed. This means that I cannot use tab or shift-tab to navigate within the PJC's editable fields/buttons. I can click on them, enter data within them, but tab is somehow intercepted. When I place my PJC within a normal (non-forms) Java window, everything works fine.
    Documentation that I've read seems to indicate that tab should navigate perfectly fine within the bean area.
    Any ideas?

    Hi,
    This is how I did it. Sorry about the formatting, it was OK when I pasted the code fragment in.
    My class contains this in the variable definitions.
    private AWTEventListener keyListener = new DoKey ();
    private class DoKey implements AWTEventListener {
    public void eventDispatched (AWTEvent e) {
    //System.err.println("eventDispatched " + e.toString());
    //System.err.println("eventDispatched source " + e.getSource().toString());
    if ((e instanceof KeyEvent) && (e.getSource() instanceof Component)) {
    * The event was a key pressed event and it was sourced from a Component.
    KeyEvent evt = (KeyEvent) e;
    if (evt.getID() == evt.KEY_PRESSED) {
    if (evt.getKeyCode() == evt.VK_TAB) {
    if (evt.isShiftDown()) {
    ((Component)e.getSource()).transferFocusBackward();
    else {
    ((Component)e.getSource()).transferFocus();
    The listener is enabled when on initialisation
    Toolkit.getDefaultToolkit().addAWTEventListener (keyListener, AWTEvent.KEY_EVENT_MASK);
    Regards, Tony C

  • Change value of string within an array?

    Alright, so im trying to change "hello" to "Aello", there fore im changing the first letter of the string to an "A". This string is within an array:
    This is what i have:
    System.out.println ((char)split[1].charAt(0))='a');
    but im getting an error

    I think you mean:
    split[1] = "a" + split[1].substring(1);
    System.out.println(split[1]);
    Strings are immutable which means they cant be changed. The only
    thing you can do is create new Strings.
    hello <- you cant make the 'h' an 'a'
    a + ello <- but you can create a new string from 'a' and the rest of 'hello'
    Edited by: TuringPest on Nov 25, 2007 10:01 PM

Maybe you are looking for

  • Not sure if I set this up correctly.

    I purchased an external hard drive from the apple store. They said all I had to do was to plug it in and it would back up my computer without me needing to do anything. They didn't have one set up in the store so that they could show me. It does hum

  • Problem with namespace

    Hi all, I am processing a EDI inbound transactions,using EDI x12 over internet business protocol. I uploaded one XSD file with a name space, but while it cuming to B2B-INQUEUE after processing the inbound transactions , its changing the name space. R

  • Error in Data updation From ODS TO CUBE

    hello Experts We are working on BW 3.5 for FI GL line items we are loading the data to ODS and than to Cube. earlier there was a process chain failure 2 months back so delta were stuck for 2 months now about 10 million records have been uploaded in O

  • JVMTI : AgentSetEventNotificationMode Causes Troubles in Lotus Notes

    Hi Everybody I have a JVMTI agent that i used to profile many java application ( Eclipse, Notes ...) I discover that I have some troubles with Lotus Notes Release 8.5.2FP4 on WIN7 64x (troubles like same time sigin windows don't open , contact window

  • Font Management Application

    Hi, I work for a small design company (of 4 people) and we are looking for a font management system that will connect over our personal server. This way we can share all the fonts we download etc... Can anyone suggest an application that isn't too ex