Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Updated window size to be cross-platform compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
dikayx committed Nov 24, 2023
1 parent 10ff008 commit 14b9aed
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package SQLite.Viewer;
package sqlite.viewer;

import javax.swing.*;
import java.awt.*;
Expand All @@ -12,12 +12,15 @@
public class SQLiteViewer extends JFrame {
public SQLiteViewer() {
// Basic window settings
String osName = System.getProperty("os.name").toLowerCase();
int width = osName.contains("win") ? 540 : 525;
int height = 700;
setSize(width, height);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(525, 700);
setLayout(new BorderLayout());
setResizable(false);
setLocationRelativeTo(null);
setTitle("SQLite Viewer");
setResizable(false);
// Same look and feel for all operating systems (using Nimbus)
try {
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
Expand Down Expand Up @@ -45,7 +48,7 @@ private void initComponents() {
JTextArea queryTextArea = new JTextArea();
queryTextArea.setName("QueryTextArea");
queryTextArea.setRows(8);
queryTextArea.setColumns(35);
queryTextArea.setColumns(36);
queryTextArea.setEnabled(false);
JScrollPane queryTextScroll = new JScrollPane(queryTextArea);

Expand Down Expand Up @@ -84,7 +87,7 @@ private void initComponents() {
// SQL selection menu
JMenu sqlMenu = new JMenu("Select");

JCheckBoxMenuItem sqliteMenuItem = new JCheckBoxMenuItem("SQLite");
JCheckBoxMenuItem sqliteMenuItem = new JCheckBoxMenuItem("sqlite");
sqliteMenuItem.setState(true);

sqlMenu.add(sqliteMenuItem);
Expand Down

0 comments on commit 14b9aed

Please sign in to comment.