Tech Overload Blog

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver java error 0

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver java error

After executing below code i get java.lang.ClassNotFoundException: com.mysql.jdbc.Driver error.How do i go about solving this mysql server connection error with java. Code import java.sql.DriverManager; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import javax.swing.JOptionPane; public class DbConnection...

How to create a simple Java JTree menu 0

How to create a simple Java JTree menu

Below code shows how to create a simple system menu using java JTree which is a swing component.JTree swing component has to be placed inside a JFrame window import javax.swing.JFrame; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.JTree;...

JTextField-setEnabled-method 0

JTextField setEnabled Method

Below code shows how to enable or disable JTextField added in a JFrame window.JTextField inherits its methods from the class swing.Note the differences between the two fields /** * * @author Eric * site:www.techoverload.net...

How to create Read Only JTextField 0

How to create Read Only JTextField

Below code creates a read-only JTextField .   /** * * @author Eric * site:www.techoverload.net */ import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.JLabel; public class JTextFieldExample extends JFrame{ JTextFieldExample() { super(“JFrame Example”); JTextField userField=new JTextField();...

creating-jtextfield 0

How to create a JTextField and adding it to a JFrame

Below code creates a JTextField and adds it to a JFrame window. import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.JLabel; public class JTextFieldExample extends JFrame{ public JTextField userField; public JLabel userLabel; JTextFieldExample() { super(“JFrame Example”); userField=new...

Creating a Label in Vaadin Applications 0

Creating a Label in Vaadin Applications

Below code shows how to create Label in Vaadi  Applications. import com.vaadin.Application; import com.vaadin.terminal.Sizeable; import com.vaadin.ui.*; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; /** * Main application class. */ public class TestApplication extends Application { public Window...

Adding TextField and Button to Vaadin Application 0

Adding TextField and Button to Vaadin Application

Below code adds TextField and Button to a Vaadin application MainWindow. import com.vaadin.Application; import com.vaadin.terminal.Sizeable; import com.vaadin.ui.*; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; /** * Main application class. */ public class TestApplication extends Application { public...

java-revalidate-method-min 0

How to dynamically update using java revalidate method

This tutorial will show you how to dynamically update  Container content using java revalidate method.Think of a scenario where you want to change JButton background color after the button implements ActionListener .revalidate method  is used...

JButton-setBackground-color-min 0

Java JButton getBackground and setBackground methods

Java JButton getBackground and  setBackground methods are used to get and set JButton background color respectively.Today’s tutorial will show you how to set JButton background color using JColorChooser. Related Tutorials How to implement Anonymous...