Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-15-2008, 11:02 AM
Member
 
Join Date: Apr 2008
Posts: 5
myclassic is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UREGENT-accessing session bean ok but entity bean parimal Enterprise JavaBeans 1 08-28-2008 03:34 PM
How to use Inner bean definitions via nested bean elements Java Tip Java Tips 0 03-30-2008 12:03 PM
property of a java bean suloverboy New To Java 3 12-14-2007 11:31 PM
How to use Inner bean definitions via nested bean elements JavaBean Java Tips 0 09-26-2007 10:36 PM
xml to java bean Peter XML 2 07-04-2007 03:39 PM


All times are GMT +3. The time now is 10:17 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org