Embedding Gecko/WebKit in Java

You could use JxBrowser. It features a Swing/JavaFX component that wraps the Chromium engine while providing a rich API and out-of-the-box hardware-acceleration through the GPU. Unfortunately, they’ve dropped support for other engines (like Gecko and WebKit) since 4.0 version. Note that it’s not free, except for open-source projects.

How to include SQLite database in executable Jar?

What library are you using for SQLite? I did a search based on the connection URI you indicated and found this one. In the documentation it says: 2009 May 19th: sqlite-jdbc-3.6.14.1 released. This version supports “jdbc:sqlite::resource:” syntax to access read-only DB files contained in JAR archives, or external resources specified via URL, local files address … Read more

Button for closing a JDialog

import java.awt.event.*; import javax.swing.*; public class YourDialog extends JDialog implements ActionListener { JButton button; public YourDialog() { button = new JButton(“Close”); button.addActionListener(this); add(button); pack(); setVisible(true); } public void actionPerformed(ActionEvent e) { dispose(); } } close only dialolg using dispose() method parent frame not closed. reason that JVM not terminated.

Show JDialog on Windows taskbar

I found the answer to your question because I had the opposite problem. I had a JDialog that was showing in the taskbar and it took me forever to figure out how to prevent it from showing. Turns out if you pass a null parent to the JDialog constructor, your dialog will show in the … Read more

JTable Right Align Header

Here’s an alternate approach to modifying the TableCellRenderer of a table’s JTableHeader. It’s not strictly necessary for this usage, but it minimizes the impact on the UI delegate’s appearance. Typical usage: JTable table = new JTable(…); JTableHeader header = table.getTableHeader(); header.setDefaultRenderer(new HeaderRenderer(table)); Custom header renderer: private static class HeaderRenderer implements TableCellRenderer { DefaultTableCellRenderer renderer; public … Read more

Drawing a simple line graph in Java

Problems with your code and suggestions: Again you need to change the preferredSize of the component (here the Graph JPanel), not the size Don’t set the JFrame’s bounds. Call pack() on your JFrame after adding components to it and before calling setVisible(true) Your foreach loop won’t work since the size of your ArrayList is 0 … Read more

Moving focus from JTextArea using tab key

According to this class: /** * Some components treat tabulator (TAB key) in their own way. * Sometimes the tabulator is supposed to simply transfer the focus * to the next focusable component. * <br/> * Here s how to use this class to override the “component’s default” * behavior: * <pre> * JTextArea area … Read more

Java OS X Lion Set application name doesn’t work

Using JDK8, you can set the apple.awt.application.name property to affect the Application menu name. However, Martijn Courteaux’s warning still applies: you must do this before any AWT classes are loaded. And AWT classes will be loaded before your main() method runs if it lives in a subclass of JFrame. Reference: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/5c1d06cd7d7b/src/macosx/native/sun/osxapp/NSApplicationAWT.m#l157

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)