Winston Gutkowski wrote:
S Chan wrote:The reason that I want to keep the properties file outside the Jar, is that after deployment, I would still like to use a text editor to edit/view the properties file in order to change certain behaviour of the program. Does that make good sense? Or is that not wise to do so?
Why not give us a bigger picture of what you want to achieve, rather than how you want to do it?
Winston
Winston Gutkowski wrote:
S Chan wrote:I have a Panasonic KX-P1121 Dot Matrix Printer here in the company. I have to write a Java app that creates print jobs for this printer. The problem is, it is a dot matrix printer which I have no experience of, and I believe it is very different from a InkJet and Laser printer in terms of resolution, font, etc...
Anyone has experience with printing with dot matrix printer using Java? Do you know if there are any online articles I can read about this? Anything pitfall I should be aware of?
Well, assuming you have all the drivers for it, I imagine it would be just like printing to any other printer (although, from the looks of it, setting the page size and/or font may be a bit trickier). This sounds to me like an OS issue, not a Java one.
The same site also has a FAQ page that suggests that it is compliant up to Windows 7 with an Epson LQ driver, but don't ask me how to set it up. All I can say is that once you can actually print to it from a regular program (eg, Word), I suspect it should print just fine from Java.
However, one might ask why your company is wasting time and money for you to write Java code to print to a printer which is so old that it's probably worth less than an hour of your wages.
Winston
Darryl Burke wrote:1. Do you know how to get all the installed Fonts? If not, go to the API for java.awt.Font, click "Use" at the top of the page, and look for a method with a return type of Font[]. Then go through the API for that method and other methods of the class it's in.
2. Do you know how to determine if a Font can display a specific String? If not, find the appropriate method in the Font API.
You can iterate over the available Fonts to identify those that are usable for the purpose, and provide an error message if none are found.
Paul Clapham wrote:I don't understand why specifying a useful font would cause a "huge increase of file size" compared to automatically falling back to that same useful font. If it were my application and I expected to be supporting CJK scripts, I would just use a font which supported them.
Rob Spoor wrote:No, but you really have to know how to use it. It's easy to write buggy user interfaces with it.
Ranganathan Kaliyur Mannar wrote:I use GBL, but I don't usually use padding. You should make use of the columns wisely. In this case, btnHlp will be on colunm 0, ok will be in column 2 and cancel in column 3. JTextArea will start from column 1 and its width will be 3. JLabel will start at column 0 and its width will be 4. Getting the in-between space will be harder, but I have done that earlier with filler JPanels. You should give the label and textarea with fill = HORIZONTAL so that, they will take up the extra width on offer.
Nam Ha Minh wrote:Look at the GridBagContraints.fill, GridBagContraints.anchor, GridBagContraints.weightx, GridBagContraints.weighy... they are very useful when working together. I have been using GridBagLayout for years and it fits all my needs from simple to complex GUI layout.
Michael Dunn wrote:> people who have good understanding and experience of GridBagLayout
well, that would be (virtually no-one) very few people
> As I have always heard that GridBagLayout is the most flexible layout manager in Swing,
'flexible' is not the first description that comes to mind
from your description, and pic, some nested panels, each with a differing layoutManager,
should handle it all comfortably. You've described what is to take the extra space when resized-up,
you will also need to handle resize-down.