Swing


Linksys WVC200 11
So you bought an IP camera and would like to store/see images from the camera using java. Recently I bought a couple of IP Cameras for testing purposes. I noticed that each IP camera has different surveillance tools and web interfaces. But most of them have in common that you can access the actual picture by entering an url in your browser. In this post I’ll show you how to see that image and store it using a very simple jav application. The camera I’ll use for the test is a LinkSys WVC200 “Wireless PTZ Internet Camera with Audio”. This […]

Viewing and storing images from an IP Camera



3
Adding a KeyListener to a JTextField to detect KeyPressed events is pretty straightforward. Buy maybe you have encountered some problems when trying to detect special key such as TAB’s. This issue is due to LowLevel keyEvents captured by Swing’s default FocusTraversalKeys. What we need to do to capture the VK_TAB KeyEvent is to remove the default FocusTraversalKeys from the component. [crayon-5a3409dfc324b525370516/] Once we’ve done this with the component, the tab KeyEvent will not be captured by swing’s default focus traversal keys and we will be able to add events normally. [crayon-5a3409dfc3252714142218/]

Detecting Tab Key Pressed Event in JTextField ‘s // Event.VK_TAB ...



2
When working with tables, it may be useful to detect selection changes. If for example, you need to sum the values of a specified column in a selection range, this method will be most essential. If you explore the available methods to add listeners to a JTable, you will notice there’s no such thing as a selectionListener. This is because the JTable has its own selection model, where you can add the listener. The following code illustrates the way to go to add a selection listener: [crayon-5a3409dfc348f708649175/]

JTable, detecting selection changes // ListSelectionListener /*Selection Changed ...


JTable inside JTable cell 11
Java is one of the greatest object oriented languages. This can easily be seen when using swing components. JTables are a great example. Briefly, jTables are just a base to display a matrix of JComponents. So inside a JTable you can embed any object which extends the JComponent class. Today I’ll show you an easy way to display a JTable inside another jTable as a cellRenderer. If you’ve ever worked with multivalued data models this can be of great help. In this simple example I’ll create a small contact manager where the name, phones, and e-mail addresses of the contact […]

Displaying a jTable inside another jTable // JTable cellRenderer


50
Jasper Reports is in my opinion by far the best report engine available for Java, even more, it’s open source! In the project page there is enough information available to build simple and some advanced reports. If you need more help you can buy some guides at the project’s owner commercial page JasperSoft There is also technical support available to be purchased. Today I’ll show you how to choose a printer programmatically. [crayon-5a3409dfc3c84902492364/] In the above code you can see how to accomplish our purpose. The first part of all is generating our JasperPrint, this is common to all methods […]

Choosing a printer programmatically in Jasper Reports



5
When you press the Enter key while in a JTable, you’ll notice how the row selection changes to the next row or to the first row if the former row selected was the last row in the model. You can change this playing with the traversal key policy, but this is quite complicated. The easy way is to consume the event if the enter key has been pressed. You can accomplish this doing the following: [crayon-5a3409dfc44ab344066451/] It’s very important to consume the event during the keyPressed event and not during the other possible keyEvents not doing so will mean that […]

Remove JTable’s Enter Key behavior