Home » Developer & Programmer » JDeveloper, Java & XML » Bean / Java PJC (Jdeveloper, Xp)
icon2.gif  Bean / Java PJC [message #347927] Mon, 15 September 2008 01:53
myclassic
Messages: 136
Registered: December 2006
Location: Pakistan
Senior Member
Dear Sir / Madam

I have created a bean using Jdevelper. if I hard code the values, it works fine on Oracle forms 10g. But when I want to pass values to parameters through set_custom_property() ... it does not work.

what could be the reason?
what is the mistake committed by me?

I am sending you people a java code. simply convert it into bean and apply on form..... see what happens.


it has two variables.

vFontName and vFontSize

if we hard code value ... it works fine.
others wise does not.....

implementation Class = oracle.forms.fd.mypackage.MousePJC
-------------------------------------------------------------
Original Code
-------------------------------------------------------------
package oracle.forms.fd.mypackage;


import oracle.forms.ui.VTextField;
import java.awt.Font.*;
import java.awt.Font;
import oracle.forms.handler.IHandler;
import java.awt.event.*;
import oracle.forms.properties.ID;
import java.awt.*;
public class MousePJC extends VTextField
{


private IHandler m_handler;
private String vFontName = null;
//private Font vFontStyle;
public int vFontSize;

private static final ID ENTER_FONT_NAME = ID.registerProperty("ENTER_FONT_NAME");
private static final ID ENTER_FONT_SIZE = ID.registerProperty("ENTER_FONT_SIZE");

public MousePJC()
{
super();
enableFont();
}
public void init(IHandler handler)
{
m_handler = handler;
super.init(handler);
}

public boolean setProperty(ID pid, String value)
{
if(pid == ENTER_FONT_NAME)
{
vFontName = ((String)value);

return true;
}

//public boolean getSizeParameters(ID pid, String value)
if(pid == ENTER_FONT_SIZE)
{
vFontSize = ((Integer.parseInt(value)));

return true;
}

else
return super.setProperty(pid,value);
}

public void ApplyFont(Font f)
//public void setForeground(Color p0)
{
// TODO: Override this oracle.ewt.lwAWT.LWComponent method
super.setFont(f);
}


private void enableFont()
{

addMouseListener(new changeFont());

}
class changeFont extends MouseAdapter
{

public void mouseEntered(MouseEvent me)
{
Font fn = new Font(vFontName,Font.BOLD,vFontSize);

ApplyFont(fn);

}

public void mouseExited(MouseEvent me)
{
Font fn = new Font(vFontName,Font.PLAIN,vFontSize);
ApplyFont(fn);
}
}


}
----------------------
please help me in this regards.
Previous Topic: Oracle Exception during Select
Next Topic: problem while searching for files in a directory
Goto Forum:
  


Current Time: Tue Dec 17 23:24:54 CST 2024