Display Japanese characters in TItle Bar Java

I can display Japanese characters everywhere except the title bar of the main window (JFrame) in Java. Is there a way to change the font of this title bar to display Japanese characters? Thanks

I am using Windows XP. If that matters, I also use the Java Substance look.

+3
source share
4 answers

The window title bar is controlled by the window manager, not Swing. You do not say which OS / GUI you are using.

Windows XP "", " " ""; ( , , , ).

, , , ( , , Katakana):

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;

public class GlyphCheck
{
    public static void main(String[] argv) throws Exception {
        final String title = "Testing: \u30CD";
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                JFrame frame = new JFrame(title);
                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                JLabel label = new JLabel(title);
                label.setSize(200, 100);
                frame.setContentPane(label);
                frame.pack();
                frame.setVisible(true);
            }
        });
    }
}
+3
JFrame.setDefaultLookAndFeelDecorated(true);
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
UIManager.put( "InternalFrame.titleFont", Resources.jaDefault.deriveFont(16.0f) );

Try it ;)
+1

Frame, , . , . , - . . UIManager, .

// Do this before you display any JFrame.
UIManager.put( "Frame.font", new Font( "Japanese", 12, Font.PLAIN ) );
JFrame.setDefaultLookAndFeelDecorated( true );

JFrame frame = new JFrame( title );

( - !) , , , Windows, .

0

Java Substance, webapp. , , .

, , . kdgregory, , .

, "", , . Windows XP :

  • "" Windows .
  • " ", "".
  • " - ".
  • "" "".
0

Source: https://habr.com/ru/post/1709542/


All Articles