Different fonts in a Form
I'm working with a form and I want to use different fonts. This is my code:
I want "Title" to be font1 and "something" to be font2. Can it be done?
private Font font1, font2;
font1 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE);
font2 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM);
append("Title"+'\n'+"something", Image.createImage ("/pic.PNG"));
Have you considered using Canvas instead for different fonts?
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
Hi, by form, do you mean a Frame, like a JFrame or something? If its a Frame or a Panel or some AWT or Swing class, then you could make two different Label objects, and align them one on top of the other. Then you could setFont() them to different forms. Also, most of the swing components accept HTML also. So, instead of JLabel.setText("Heading\ntext");, you could give in JLabel.setText("<html><h2>Heading</h2><p>text</p></html>"); Only thing is it has to start with <html>
By zobi316 in forum VB Classic
Last Post: 03-10-2008, 08:05 AM
By eldiener in forum .NET
Last Post: 01-17-2007, 11:38 PM
By maheeru in forum VB Classic
Last Post: 08-09-2005, 01:59 PM
By Al Guten in forum .NET
Last Post: 04-11-2002, 07:48 PM
By Mark Alexander Bertenshaw in forum VB Classic
Last Post: 03-16-2000, 01:14 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center