You can easily display images by wrapping them in a JLabel:
import javax.swing.*;
Public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Image test");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add( new JLabel( new...
Here's an algorithm I wrote. It's not very readable, but it works as follows:
Let's say, we have an array of five numbers: {1,2,3,4,5},
and we want to find all possible groups of three numbers. My algorithm goes through the combinations like we humans would probably do it:
helper array i[] =...
Hi,
I would also suggest to use a custom Layout Manager. I found two nice ones in the book "Graphic Java: Mastering the AWT" by David M. Geary. They are called "RowLayout" and "ColumnLayout".
I can send them to you by E-Mail if you like. My E-Mail is...
OK, probably you have the plugin installed. Maybe the following helps you (found at http://forum.java.sun.com/read/16788905/qACOliCWns1MAAYe1#LR
)
The SwingApplet.html file does not invoke the Plug-in. It displays the applet in browsers that support Java1.2 natively (eg: appletviewer).
You...
Hi! Here's a program that does this kind of word count. Please note:
- The code is only meant to give you some input (it's not very elegant)
- I think using a hashtable is a good idea. The only problem is to sort the table when it's complete.
- My program reads the file line by line. Maybe you...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.