-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
35 lines (29 loc) · 1.47 KB
/
Copy pathMain.java
File metadata and controls
35 lines (29 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.abhidhan.dictionary.main;
import com.abhidhan.dictionary.database.DictionaryDatabase;
import com.abhidhan.dictionary.ui.HomeScreen;
import javax.swing.*;
import java.awt.Font;
public class Main {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
try {
// Use FlatLaf for a modern look and feel
UIManager.setLookAndFeel(new com.formdev.flatlaf.FlatLightLaf()); // Or FlatDarkLaf(), FlatIntelliJLaf()
// Set a default font that supports Bangla *globally* for the application.
// This is a good fallback, but we'll also set it explicitly on components.
Font defaultFont = new Font("SolaimanLipi", Font.PLAIN, 14); // Replace with YOUR font
UIManager.put("defaultFont", defaultFont);
} catch (Exception ex) {
System.err.println("Failed to initialize FlatLaf Look and Feel");
// Continue running even if L&F fails
}
DictionaryDatabase.initializeDatabase(); // Initialize database (creates tables and loads data)
JFrame frame = new JFrame("Abhidhan");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(new HomeScreen().getMainPanel());
frame.pack();
frame.setLocationRelativeTo(null); // Center the window
frame.setVisible(true);
});
}
}