2001 JI Open Discussion Posted August 17, 2006 Share Posted August 17, 2006 By: Mark Engstrom - me2kme Setting backcolor 2002-07-29 03:20 Hi, I have some java code that is modifying a report design, particularly attempting to set the fore and back color of <textFields>. For example :- JRDesignTextField textField = new JRDesignTextField(); textField.setBlankWhenNull(true); textField.setStretchWithOverflow(true); Integer nextXPos = (Integer)m_data[1]; textField.setX(nextXPos.intValue()); textField.setY(0); Integer width = (Integer)m_data[2]; textField.setWidth(width.intValue()); textField.setHeight(8); textField.setTextAlignment(JRDesignTextField.TEXT_ALIGN_LEFT); JRDesignExpression r = new JRDesignExpression(); r.addFieldChunk(columnName); r.setValueClass(columnName.getClass()); textField.setExpression®; Boolean flag = new Boolean(true); if ( j == 0 ) { // If there is an account specified. Set to Cyan. textField.setForecolor(new Color(77, 188, 252)); ................................. When I compile and generate the report, the text is coloured accordingly. What I want to do is set the backcolor property but this doesn't seem to have any effect on the report. Is there some other condition I need to set, can anyone help ?. Thank you. Mark By: Teodor Danciu - teodord RE: Setting backcolor 2002-08-05 02:54 Hi, You need this: textField.setMode(JRElement.MODE_OPAQUE); Text elements are transparent by default. Good luck! Teodor By: Bart Cassady - bartong RE: Setting backcolor 2002-10-09 13:41Would you then update your Quick Reference documentation to reflect this? It currently states that the default mode IS "Opaque", Thanks. Bart By: Teodor Danciu - teodord RE: Setting backcolor 2002-10-09 15:26 Hi, I'll do that. Thank you, Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now