Sitemap

Amicuk Programming Answers

How to position things based on the size of Text widget

-0001-11-30   Views:0

Advertisement

e.g. If I want to place the center of the baseline of a simple string over a certain point, what would I do? Text t = new Text("Hello"); t.setTextOrigin(VPos.BASELINE); I was thinking of doing something like: t.setTranslateX(-width/2.0); But I c

e.g. If I want to place the center of the baseline of a simple string over a certain point, what would I do?
Text t = new Text("Hello");
t.setTextOrigin(VPos.BASELINE);
I was thinking of doing something like:
t.setTranslateX(-width/2.0);
But I can't get the width. Text does not have a "width" property!
How do I know what X coordinate corresponds to the center of the Text node?
Font doesn't have any methods for computing bounds of characters or strings
EDIT....
As usually I think I've found a way a couple seconds after posting...
text.prefWidth(-1) appears to return a reasonable value.
EDIT #2...
Looked reasonable but isn't right. So far I've had to wrap the Text in a Pane just so I can bind to the width of the Pane. That seems like jumping through too many hoops.
Edited by: swpalmer on Dec 19, 2011 11:41 AM

The replay answer
Advertisement
Well, you can not create dependencies like this, but you could use nested master pages. You would still need 30 master pages for 30 chapters, in order to place the chapter number in different positions, but you
would only need one or two main master pages for the rest of master page content. That would make it at least easier to change something on all master pages at once.

Go to See the other 2 answers

How to position things based on the size of Text widget

Category:DefaultRelease time:-0001-11-30Views:130

e.g. If I want to place the center of the baseline of a simple string over a certain point, what would I do? Text t = new Text("Hello"); t.setTextOrigin(VPos.BASELINE); I was thinking of doing something like: t.setTranslateX(-width/2.0); But I c[More]

RandomAccessFile date position changed  while increasing font size of text

Category:DefaultRelease time:-0001-11-30Views:130

i have created RandomAccessFile and write data in a specific locations using seek() in it but problem is when i changed font size of that file data position is changed please anybody can guide me how can i solve it.fonts have nothing to do with rando[More]

Photo Gallery w/ Images adjusting size based on Browser size.

Category:DefaultRelease time:2015-10-11Views:130

I'm new to web design but I'm trying to create a photo gallery with images that dynamically size based on the size of the browser window. Similar to this http://pageduke.com/#/Residential/Colonial%20Revival-Nashville1/1. I know th is a flsh site, but[More]

Creating fonts based on pixels size

Category:DefaultRelease time:2015-10-11Views:130

Hi i'am still a java beginner and i am switching from .NET so anyone can help on how can I create a font based on Pixels size rather than Point SizeYou can translate between points size and pixels size using the DPI: http://java.sun.com/products/java[More]

How to pick the multiples based on file size

Category:DefaultRelease time:2015-10-11Views:130

Hi All, my sender file adapter needs to pick up 5 files based on file size. for example 1file size is 500kb,2nd file size 300kb,3rd file size 400kb, 4file size 100kb and 5file size 600kb. here my requirement is, my file adapter needs to pick in the b[More]

Set font size based on component size

Category:DefaultRelease time:-0001-11-30Views:130

Hi everybody, This is kind of a duplicate, kind of new, because my original post is buried and I figured out a more helpful and general way to ask this question. Does anyone know if there is a way to set the size of a string as large as possible on a[More]

Set maximum size in Text Form Field Options for a field in bi publisher RTF

Category:DefaultRelease time:2015-10-11Views:130

Hi All, How to set maximum size in Text Form Field Options for a field in bi publisher RTF. I have a RTF whch is having a field in that i need to add some validation condition but after adding certain condition in Add help text tab ,it is not accepti[More]

When using the "Fill & Sign PDF" feature, is there a way to stretch to size the text box, for a specific area on the page...instead of it going on in one straight long line...?

Category:DefaultRelease time:2015-10-11Views:130

When using the "Fill & Sign PDF" feature, is there a way to stretch to size the text box on a specific area of the page...instead of the text box going on in one straight long line....? I'm not seeing there's an option or ability to do so, j[More]

How to increase the size of text boxes in FCPX without stretching the text inside?

Category:DefaultRelease time:2015-10-11Views:130

How to increase the size of text boxes in FCPX without stretching the text inside?There are two basic Title formats - I should say Layouts - available:  Text (plain) and Paragraph.  (The plain text version usually does not appear with the blue dot co[More]

How to change the font size of text and case in smartforms

Category:DefaultRelease time:2015-10-11Views:130

hi,    could any one explain how to change the font size of text in smartforms. ex. previously i had taken P4 left aligned and C6 but now i want to decrease the font without making it bold. pl......... guide me    secondly the value which are coming[More]

How to change the font size of text element in smartform

Category:DefaultRelease time:2015-10-11Views:130

Hi i want to know how to change the font size of text element in smartform regards GincyHi You can create Smartstyles, in which you can define paragraph formats for texts and character formats for character level changes. Paragraph format ---> alignm[More]

Hot
Hi. I'm attempting to establish a connection with an Access db using ODBC. I've edited my listener.ora file to read the following: # listener.ora Network Configuration File: C:\oracle\product\10.1.0\Db_1\network\admin\listener.ora # Generated by Orac [More]
Hi, We are about to install a new network consisting of Cat 4500s with Sup7E at the Access Layer, with Nexus 7000 at the Distribution and Core layers. We have 14 floors with at least three 4500s on each floor. Within the office block where the Access [More]
Hi guys,  I have a small issue with my nokia n8 after upgrading to belle.  it seems everything works just fine except, my email client which is now in Chinese... The sistem language is English and everything is in english, except for the mail client. [More]
In the Beats Audio control panel (I own a Pavilion dv7-4051nr) the only option listed for Independent Headphone is default communication device. The only time I have been able to enable Independent Headphone for sound playback was through Windows Med [More]
dear sir,     I want to issue cheque so that configuration and process(steps)Hi, If you want to make the payment through Automatic Payment Mode and issue the check you can go with FBZP, If youu2019re doing manual payment and issues of check, then you [More]
Hi, How to convert the data picked from table into different language in form. for ex: name, street, land , regionHi, I believe you are trying to get the address of the reciever into different language. You can try writing program lines to pick the d [More]
FaceTime does not connect to server under Lion.I did face (no pun intended) the same issue and I think I've found the culprit(s). Like in any good conspiracy theory, there's always agents provocateurs to seek out and vanquish. I have replied in one o [More]
Hi Friends ! I would like to know how many available retractors are possible from BPC to ECC: 1) Fund Management - BPC to BI & then Standard Tcode in ECC 2) PCA - Only possible for flat file upload Is there any more retractors? any presentation avail [More]
Hi , I am running into org.apache.poi.hssf.record.RecordFormatException, while creating excel work book. Few of the worksheets in the workbook are password protected. If i remove the password proted worksheets then i am able to load the workbook and [More]
My original BB was sent away to get fixed under warranty but Blackberry just sent me a new handset instead which I have just put my SIM card in to. I am currently on the o2 network, get unlimited internet/e-mail. I think the operating system is v5.0. [More]