Formatting swing for properties file

this relates a bit to the last post I put on here about JTextAreas.
I have a lot of properties files that contain strings used throughout the program.
I was wondering what the ideal way of going about the formatting of the swing components the strings are used inside in relation to the properties file.
The problem is that the lengths of the strings vary so much (and are used the same way), that its not a "one size fits all" screen.
The properties only has the most required of \n's in it (This is the standard, correct?), so you have to setTextWrap(true) for the JTextArea. The problem with this is you do not have a way of dedecting the height.
We are trying to get all of the message boxes formatted the same with the same length between the end of the text and buttons at the bottom, but cannot come up with a good way of doing this. character counting with FontMetrics does not work well since there are a few \n's in it. Adding \n to the properties file doesn't seem like an accurate solution. So basically, I have two questions:
1)Does anyone have a way of dedecting the height of this jTextArea with textwrap on?
2)What is the standard for interaction and spacing between a properties file and swing component?

Could you post a small example, compilable and runnable, code that can reproduce your
problem? I reread your first post and recognized that I didn't have understood your problem
fully and in detail.
trying to get all of the message boxes formatted the same with the same length between
the end of the text and buttons at the bottomThis sentence is quite hard to swallow without real code or screen shot.
Why multiple text areas?
Buttons? What buttons?
etc., etc. Questions are endless.

Similar Messages

  • Format Text in properties File

    I have a large amount of text for an element in the properties file that I'd like to format. I'm retrieving this value and displaying it in the tip of a panelLabelAndMessage ADF component. For example, in the properties file I have the following:
    displayparagraph=This is the first paragraph.This is a second paragraph I'd like on a new line.
    I'd like this text to be broken apart onto new lines when it displays in the tip element, like this:
    This is the first paragraph.
    This is the second paragraph I'd like on a new line.
    I'm not sure how to go about doing this or if it's even possible. I've tried placing \n, \\n, \r, \r\n, etc...inbetween the "." and "This" but this doesn't appear to work.
    I'd also like to a portion of that same message be underlined as a link...not sure if that is possible either.
    I have to keep the text in the properties file for translation purposes and I can't really break up the sentences into seperate elements to ensure that translations doesn't lose the meaning of the tip.

    Hi,
    If you set the escape property to false on your output components you can put HTML code in your properties file for the components that you want to format differently.
    Not all components can do this but the key ones like OutputText do.
    regards,
    Brenden

  • Load the path for properties files

    Hi;
    My application uses of the properties files which are stored in a repertory /properties at the same level that JAR.
    I search an good means to configure the path of the files properties: for example: a environment variable or another mean?
    My application will read from this env variable (or another means) the path where are stored the files to use them.
    Regards;

    If the properties file is fixed, then it's best to make it a resource as suggested and put it inside the jar.
    OTOH if you have a situation where the properties file is dependant on installation or even writable then that won't do.
    In a lot of cases where the properties are variable it's better to use the Preferences class, on Windows this will put the data in the registry.
    You can use a command line argument, of course, to specify the location of your configuration file. I tend to use java System.getProperty and -D command line switches. That has the advantage that you don't have to send the value down from main() to where you are using it.

  • How big is too big for .properties file for a ResourceBundle?

    The subject says it all. We are using ResourceBundles to manage the dictionary of English/French literals for our web enabling project. Our .properties file is currently 675 key/value pairs. How big can .properties files grow before they are too big?
    Thanks,
    Don Booker - Programming Team Leader
    Common Departmental Financial System
    Public Works & Government Services Canada

    The resource gets loaded into memory, so there's a memory cost that increases with the number of properties. (There's also a time cost when it loads, but that's only once.) And finding one of the properties requires a search, so there's a processing cost involved. But it's based on a Hashtable, so it isn't a major cost even if the number of properties gets very large.
    So there's your constraints. The question is, though, what is your alternative when the resource does get too big? A database? That reduces the memory cost but increases the processing cost. I would guess you could let your properties file grow a lot before you were forced to go to a database, but actual testing would help.

  • Encryption for properties file in Weblogic server 6.1

    My application needs to connect to a file server. I need to encrypt the password in properties file. Is there a built in encryption tool in weblogic server 6.1 to achieve that?
    Thanks

    My application needs to connect to a file server. I need to encrypt the password in properties file. Is there a built in encryption tool in weblogic server 6.1 to achieve that?
    Thanks

  • High quality format conversion for .mod files?

    I'm using MPEG Streamclip to convert .mod files to formats acceptable to FCE 3.0. I've tried a few dozen possibilities, but the files are either unreasonably huge (687 MB for 23 seconds of video) or of poor quality. Does anyone know of a high quality format that requires something on the order of 3.6 MB/min? A previous post (http://discussions.apple.com/thread.jspa?messageID=4815749&#4815749) recommends DV or HDV, but MPEG Streamclip gives many options for DV. Any help would be much appreciated.

    They come from a Panasonic SDR-H200. The .mod clip in MPEG Streamclip looks great. Here's the information MPEG Streamclip gives for the clip:
    Type: MPEG program stream
    Duration: 0:00:23
    Data Size: 12.48 MB
    Bit Rate: 4.45 Mbps
    Video Tracks:
    224 MPEG-2, 704 × 480, 4:3, 29.97 fps, 9.54 Mbps, upper field first
    Audio Tracks:
    128 AC3 2/0, 48 kHz, 256 kbps
    Stream Files:
    MOV001.MOD (12.48 MB)

  • File format error for xml file

    Hi!
    We are trying to upgrade our SAP 4.6C to EHP4.
    While "configuration roadmapstep", system asks us the XML file we have
    produced via solman. When we enter the path of the file system gives theerror below:
    The selected configuration file
    ("E:\downloadupg\SMSDXML_FKQ_20100917142727.656.xml") is not useable.
    Reason: "File format error"
    We have tried the txt file instead of xml file. The result was same.
    You can find the details of our system.
    4.6D EX2 32 bit kernel
    windows 2003 64 bit OS
    sql 2005 64 bit database software
    We have to upgrade our system until that monday.
    Please help us as soon as possible.
    Best regards
    Noyan Durna

    Hello Noyan,
    first, the official information: please refer to note #1022704 - for source release 4.6, the TXT file has to be used instead of the XML file. Otherwise, 'File format error' will occur as in your case.
    But since you tried this option, you should turn your attention to the XML itself, which must contains entries that are not handled by function module OCS_GET_UPG_STACK_INFO in the 4.XX source systems. The function module only expects the entries [SPAM_CVERS], [PRDVERS] and [SWFEATURE].  Any other entries present on the file can cause an error. 
    Please check your file for other entries like [APP_SYSTEM], [SWFEATUREINC], [TECHUSAGES], [INITIAL_CVERS], [EXPORT_CVERS], and [DVD_SET]; this might be the cause of the error. 
    In order to workaround this, you can either edit the file and remove the invalid entries or recreate it (w/o this entries also).
    Best regards,
    Tomas Black

  • How I fixed the "unsupported image format" error for RAW files

    After deleting the .plist file stopped working, I decided to go ahead & reinstall Aperture and...voila--problem fixed. RAW files are again displaying without any trouble (just like they used to!)
    G5 2.3DP   Mac OS X (10.4)  

    Just an update. Restarted computer and attempted rebuilds of iPhoto library a couple more times and finally files and photos mostly recovered, except for those I had tried to open. Aperture seems to have a problem, or a host of them, dealing with RAW files, and there is no update yet for the Sony RX1R for Aperture or iPhoto. Lightroom 5, on the other hand, seems to work great with these files directly, so that will be where all photos go for now. Will iPhoto and Aperture just become old archives? It is so infuriating that Apple does not allow for simple importing and exporting compatibility with such an excellent program as Lightroom 5 just to protect their somewhat poorly supported Aperture. I've been a staunch Apple supporter and user since the 80's, but having more doubts about the direction this company is taking.

  • Date format (YYMMDD ) for the file

    HI All,
    I need to place a file with file name that should include the date in the format YYMMDD. Currently the format is DDMMYY.
    How can i do that?
    Thanks In advance!!

    Perhaps by changing the date format in the personal settings of the user that creates the file.
    Check transaction su01 - username - defaults
    Kind regards,
    Mark

  • Encoding issue in properties files generated with l10n tooling

    Hello,
    I recently try to alter my encoding settings as follows :
    * UTF-8 as workbench default, and for all content types
    * one exception : ISO-8859-1 for *.properties files (in order to conform to the specs of this format).
    Now this gives me an issue when using the l10n tooling: apparently, all the generated properties files are encoded in UTF-8 (the new workbench default), ignoring the content type specific settings.
    The sad result : hieroglyps.
    Isn't there any way for me to specify the generated properties files should be encoded in ISO-8859-1... ?
    Thomas

    please file a bug we need generate those files in 8859-1 all time
    because this is what the spec says.
    Tom
    On 27.07.15 17:18, Thomas Elskens wrote:
    > Hello,
    >
    > I recently try to alter my encoding settings as follows :
    > * UTF-8 as workbench default, and for all content types
    > * one exception : ISO-8859-1 for *.properties files (in order to conform
    > to the specs of this format).
    > Now this gives me an issue when using the l10n tooling: apparently, all
    > the generated properties files are encoded in UTF-8 (the new workbench
    > default), ignoring the content type specific settings.
    > The sad result : hieroglyps.
    > Isn't there any way for me to specify the generated properties files
    > should be encoded in ISO-8859-1... ?
    >
    > Thomas

  • API to access and set properties for MP4 files

    I am looking for some APIs in Visual C++ to use in Visual Studio to set
    and get properties for .mp4 files. Can anyone help me in this regard?

    Hi Rahul,
    Try using the Windows Media Format SDK with help from the below document:
    http://blogs.msdn.com/b/tims/archive/2004/03/28/extracting-metadata-from-windows-media-files.aspx
    Alternatively, you can give a try to ffmpeg libraries for a open source alternative.
    https://www.ffmpeg.org/download.html
    (Please mark as answer if this solves your query. Please upvote if this reply is helpful).
    Regards,
    Rajesh Nath

  • Format of WCS template file for mac-address filtering

    I am looking for the format of the template file used for WCS Mac-address filtering.
    I need to know how the fields are delimited within the file.

    Sample csv file :
    #MAC Address,Profile Name,Interface,Description
    22:22:22:22:22:22,profile8,management,cisco
    00:00:00:00:00:01,myprofile,int1,First filter
    00:00:00:00:00:02,,management,Second filter
    00:00:00:00:00:03,,,Third filter
    Note: "MAC Address" and "Description" are mandatory fields

  • How to give Path for a properties file

    Hi,
    I am using a SQL.properties file to load all my SQL statements to my EJB JDBC prepared Statement. I have placed the SQL.properties file in com.company.sql package. I have another SQL class in the same package which is loading the SQL.properties file to cache for future use. I am using the path as "SQL.properties" (the file name straight ) in the SQL class to access the properties file.
    I am using Sun App Server 7. To get access to this file I need to copy the SQL.properties file to the config directory of the app server instance. Otherwise it is not able to locate the file. I don't want to put the properties file in the config directory of the app server instance. Please help me, what path I have to give to access the file from the package itself, rather from the config directory of server instance.
    I think , some one who is doing localization can help me out here. They have to put the localized properties file to access the text out of it. Please help me. Thanks in advance.
    Thanks
    Amit

    You can use ResourceBundle class to load this properties file from the classpath:
    ResourceBundle props = null;
    props = ResourceBundle.getBundle("com.company.sql.SQL");

  • Different formats of the flat file for the same target

    In our deployment, we use plugin code to extract the csv files in the required format. The customers are on same version of datamart, but they are on different versions of source database - from 3.x to 4.5 depending on which version of application they are using. In 4.0, we introduced a new column email in the user table in the source database. Accordingly, plugin will add the field in the csv file. But not all the customers will get the upgraded version of plugin at the same time. So ETL code needs to decide which data flow to process depending on the format of the csv file to load data to the same target table. I made the email field in the target table nullable but it still expects the same format of the csv file with delimiter for null value.
    Need help to achieve this. Can I read the structure of the flat file in DS or get the count of delimiters so that I can use a conditional to use different data flow based on the format of the flat files.
    Can I make the email column in the flat file optional?
    Thanks much in advance.

    You can add an email column that maps to null in a query transform for the source that does not contain this column. 
    Or else you can define two different file formats that map to the same file.  One with the column and one without

  • This is an error from my HP scanner. How can I fix the problem? An error has occurred saving the file because it could not be written to. Check the properties for the file to make sure it is not read-only.

    I recently uploaded the Maverick operating system. I wanted to scan some things on my HP Printer/Scanner and could not . This is the error message I received: An  error has occurred saving the file because it could not be written to.   Check the properties for the file to make sure it is not read-only. I am a novice with the computer and have no one to help. I hope someone knows an easy fix.
    Thank you

    This worked for me:
    "Although it is not a 'fix' for the HP issue, I did find a workaround that helped me. In the Preferences Panel in MacOS X you can pull up the Printer/Scanner preferences and scan directly from OS X. I'd not known of this prior to posting here and it worked like a charm."
    "Of course, HP should still update their software, but it's good to know that Apple has it covered for them."
    I found it here:
    http://h30434.www3.hp.com/t5/Mac-Printing-and-Scanning/MAVERICKS-WONT-SCAN-HP-C3 09A/td-p/3052105

Maybe you are looking for