JLabel label = new JLabel("Hello World"); Font defaultFont = UIManager.getFont("Label.font"); label.setFont(defaultFont);
JButton button = new JButton("Click me"); Font customFont = new Font("Arial", Font.BOLD, 16); button.setFont(customFont);The javax.swing package library provides access to the javax.swing.UIManager class and its methods.