View Snippet

JMenuBar Example

  Java Controls

Viewed: 1052

Date: 2010-06-22

This code snippet demonstrates how to use the JMenuBar component and how to add menu items using the JMenu and JMenuItem components.

New Snippets

Update Content Label Text From Master Page ASP.Net - C# Miscellaneous

The following code snippet demonstrates how to update the Text property of a Label control located in a page which uses a master page from within the master page code behind file.

HTML Table Paging Javascript Navigation

The following code snippet demonstrates how to apply paging to a HTML table element.

Get Textarea Data Length Javascript Miscellaneous

The following code snippet demonstrates how to display the data length of a textarea element as the user types in data.

Custom TextBox Control With BackColor Hover C# Controls

The following code snippet demonstrates how to create a custom TextBox control, which can change its background color when a user hovers over the TextBox control.

TextBox Validating Event C# Controls

The following code snippet demonstrates how to validate TextBox controls using the Validating event.

Bing Map Control C# - Windows Mobile Controls

This simple code snippet demonstrates how to set the latitude and longitude for the Bing Map control.

Count Down Timer C# - Windows Mobile Miscellaneous

This code snippet demonstrates how to use the DispatcherTimer class to create a count down timer.

Edit And Update A listView Control ASP.Net - C# Controls

The following code snippet demonstrates how to bind a ListView control to a DataTable object and allow the user to edit rows using the ItemEditing and ItemUpdating events of the listView control. This example uses a Microsoft SQL Server and connects to the sample AdventureWorks database.

Remove All Options From Select Javascript Miscellaneous

The following code snippet demonstrates how to clear a select element and remove all options from it.

ListView With DataPager ASP.Net - C# Controls

The following code snippet demonstrates how to page through a ListView control using the DataPager control.

Bind ListView To DataTable ASP.Net - C# Controls

The following code snippet demonstrates how to bind a ListView control to a DataTable object. It also shows how to use the ItemTemplate to display the data.

XmlWriterSettings Example ASP.Net - C# XML

The following code snippet shows how to indent Xml data when using the XmlWriter class.

Deserialize Object From Xml File ASP.Net - VB XML

The following code snippet demonstrates how to deserialize an object from an Xml file and cast the object back into its original type.

Serialize Object To Xml ASP.Net - VB XML

The following code snippet demonstrates how to serialize an object and save it to an Xml file using the XmlSerializer class.

Save And Load Images Drawn On Canvas C# - Windows Mobile Graphics

The following code snippet demonstrates how to draw on a canvas. The canvas image can then be saved and loaded. Images are saved to isolated storage.

Top Java Snippets

This code snippet demonstrates a very simple file transfer program. In this example the client program sends a file to the server. The client program is a GUI and allows a user to browse for a file to send to the server.

This code snippet shows an example RMI Client/Server. The Client connects to the server and executes the GetMessage method. The server prints the message sent by the client.

This code snippet gets the selected node of a JTree component and displays it into a message box.

This snippet shows how to connect to a MS Access database.

This code snippet shows how to add an ActionListener to a JMenu component.

This code snippet shows how to read an XML file.

This snippet shows how to connect to an MS Access database and query a table. The results are then displayed in the console.

This code snippet shows how to populate a JTable component with data.

The following code snippet shows how to create a simple MySql class that can be used to create a connection to the database server and execute queries which return a ResultSet object.

This code snippet shows how to connect to a MySQL database server. You will need to download Connector/j.