javascriptwww Posted October 18, 2021 Share Posted October 18, 2021 I encountered a problem, how to calculate the required height of the text in the TextField with "Stretch with Overflow" attribute in Java.I have been trying for a whole day, but I still don't have a better idea. I have two ideas.The first is to put the text in the TextFiled and get the height, but the obtained height is always the original height of the TextField.The second is to put the TextField into JRDesignBand and get the next Band Y-axis height, but I don't know how to achieve it.I need to calculate the height accurately to achieve a strict report format, so I really need to use this method. Thank you very much for your help.The following snippet code I tried. JRDesignTextField textField = new JRDesignTextField(); textField.setWidth(183); textField.setHeight(38); textField.setStyle(normalStyle); textField.setStretchWithOverflow(true); textField.setExpression(expression); System.err.println("TextField Height: " + textField.getHeight());[/code] 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