Results 1 to 1 of 1
Thread: Bean / Java PJC
- 09-15-2008, 09:02 AM #1
Member
- Join Date
- Apr 2008
- Posts
- 5
- Rep Power
- 0
Bean / Java PJC
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('TEXT_ITEM4',1,'ENTER_FONT_NAM E','TIMES NEW ROMAN');
set_custom_property('TEXT_ITEM4',1,'ENTER_FONT_SIZ E',18);
from Forms 10g.
... 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.
Similar Threads
-
UREGENT-accessing session bean ok but entity bean
By parimal in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 08-28-2008, 01:34 PM -
How to use Inner bean definitions via nested bean elements
By Java Tip in forum Java TipReplies: 0Last Post: 03-30-2008, 10:03 AM -
property of a java bean
By suloverboy in forum New To JavaReplies: 3Last Post: 12-14-2007, 09:31 PM -
How to use Inner bean definitions via nested bean elements
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:36 PM -
xml to java bean
By Peter in forum XMLReplies: 2Last Post: 07-04-2007, 01:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks