eclipse default font in ubuntu 12.04 - java

I have asked this question on askubuntu thinking that it may be related to ubuntu but now that I think about it, it may rather be related to eclipse so I wanted to ask in here as well.
I'm using eclipse on my ubuntu 12.04 system. Currently the default font in eclipse is set to monospace (mostly) although my system monospace font defaults to ubuntu mono (checked from gnome-tweak-tool). I have found this in the eclipse documentation where it says
By default, the Workbench uses the fonts and colors provided by the operating system. However, there are a number of ways that this behavior can be customized.
I was wondering why eclipse is not using my system fonts. I can change the font from the preferences but there are a lot of different font settings for different places and I am using a few different eclipse's on my system so it would be nice to find something that would work globally.

Related

Changing the default icon in Netbeans' native deployment feature for Java apps

I know the question is very long, but in a nutshell it's just that. As you know Netbeans has a feature with the help of inno setup that allows the creation of .exe installers of Java applications. The problem is that I would like to change the default icon it has (a grey java icon) for a custom one.
I have searched a lot through both Stack and Google and I haven't found anything. The closest it got is to change it via Launch4j. The thing is if it is possible to do it within Netbeans.
Furthermore, I was wondering if there is a possibility to add several languages to the installer and some other features like the creation of a desktop icon. I guess if the option exists it would be in the same place as the change-icon... but I am completely lost regarding this issue.

Multi language software to run on two platforms

i had developed application in ubuntu using eclipse platform .i used our local language as displaying in gui forms.i used JLabel b = new JLabel("fonts of local lanuage(gujarati)");
i works properly in ubuntu but when i run this on windows it wont show properly means it displays like [][][][][][][].how to correct it.plz help me.
That may refer to Font. make sure you have fonts available in windows.
This is a link to a unicode to un-unicode converter. it may be useful
Yep the problem that you are facing is the font that is why when you run on windows it comes up like this
[][][][][][][]. The simplest solution to this is use a font native to windows such as Arial or Times New Roman.

Crash when calling autoSizeColumn on worksheet, when run under Linux (Servicemix)

I've written module that generates excel, and deployed it under Servicemix. In Windows environment everything is fine, but under Linux Servicemix unexpectedly crashes on following call:
for (short i=0;i<=3;i++) {
log.trace("AutoSize column {}", i);
worksheet.autoSizeColumn(i);
}
I'm using POI version 4.2-FINAL, FuseESB 4.2, Java 5.0. There are, however, no hs_err*.pid files. Servicemix logs ends on first autoSizeColumn call.
Did anyone met such behaviour and know, how it is caused and how to come this around?
In order to be able to calculate the column widths, POI needs to get hold of the Font in use, and ask it to size each character in turn. On all JVMs that I know of, this requires a graphical environment, because the actual work is delegated by the JVM to the underlying graphical system.
If you're on Windows, you always have a graphical system so that's fine. On Linux, if you're running on the command line on a server, you may not. (Linux as a desktop is fine though)
If you are running on a linux server without an X server running, you'll need to tell Java to run "headless". As taken from the POI AutoSize documentation
To calculate column width Sheet.autoSizeColumn uses Java2D classes that throw exception if graphical environment is not available. In case if graphical environment is not available, you must tell Java that you are running in headless mode and set the following system property:
java.awt.headless=true
Try setting that when you start your JVM, and I've a hunch it'll fix your issue (which is most likely caused by Java not finding a complete graphical environment)
We haven't tested it as it's not released yet, but since POI 5.2.3 there's a boolean system property that could help: org.apache.poi.ss.ignoreMissingFontSystem
Instructs Apache POI to ignore some errors due to missing fonts and
thus allows to perform more functionality even when no fonts are
installed. Note: Some functionality will still not be possible as it
cannot use default-values, e.g. rendering slides, drawing, ...
Hi I faced a similar problem. I didn't have any crash, but on my development environment (Windows) the autosizecolumn worked. On production environment (Unix-like) it didn't work. I put system property java.awt.headless=true but I had the problem still. I solved following this solution but I added all the Arial Family fonts. Hope it helps anyone.

Java Swing positioning elements differently in different operating systems

I have written a Java Desktop Application that runs in Windows, Mac OS X, Ubuntu and Open Suse. I am having issues with is positioning thing differently in Linux.
I developed the application with NetBeans using the designer, it looks as I would expect in Windows and Mac OS X, but in the Linux distros certain label controls have shifted into different positions.
Is there a common reason for this?
Perhaps Linux uses a different font. One where letters have a different width.
You could try to explicitely set a specific font for your Look&Feel. It should be a font which is installed on all of your target platforms.
The most probable thing is that you use different Look and Feel for every platform. If you're developing in Windows you do layouts to fit for Window style only. But Linux has different L&F with different margins and font for GUI components. Metal style (basic for Linux) and its descendants (Nimbus and GTK+) have larger default system font and heights for components. I think, that must be a reason why you have shiftings.
The way to fix that is to check program looking in both platforms. I'd suggest to develop in Metal style because Windows has smaller fonts, as result, everything which fits in Metal will fit in Windows.
I'm assuming you developed the thing on Windows or Mac, that's why it looks "as expected". Can you compiling/running the code in your IDE on Linux and see how it looks?
My guess is that one of the implementations of the containers is flawed. I saw this sometimes when I did cross-development and mostly did trial-and-error modifications to fix it (by changing to use other classes). It also helped to have one developer working in Windows and another in Linux, so that we would easily spot and fix problem areas.
I changed the Layout style from 'Free Design' to 'Absolute'

Default Fonts in Java

I have some Swing code (written in 1.6 for 1.6) that specifically sets the font in a text area to Courier, but on some Windows systems, this shows up as Arial (the system default?) instead. Does that mean a font is missing from the system? What is the behavior Java has when it can't find a font it is looking for? Does it complain? Does it log it somewhere? Does it immediately resort to using the system default? Is the behavior different between 1.4/1.5/1.6 versions of the JVM?
Has anyone else ever run into this? I was very surprised to have something different from what I HARDCODED into the application show up in the UI - and only on some systems. The core issue is that I need a monospaced font style for this particular case, and Arial is not monospaced. Is there some way to specify a fallback if a certain font is not found? Something like:
if font is available use "Courier"
else use "monospaced"
???
You should first check if "Courier" is among the results of GraphicsEnvironment.getAvailableFontFamilyNames()
I don't know any built-in mechanism in Java for "if-unavailable-fallback-to" behavior.
According to this article1 the only monospaced TrueType fonts shipped by Microsoft are Courier New and Lucida Sans Typewriter.
It might expect you to specify "Courier New" for Courier. I don't have a Windows system, so I can't verify this.

Categories