Advertisement
Nickname
charles
Registered since:
February 26, 2002
Short bio:
Retired Comet astronomer Java programmer
Home page:
http://cometskies.com
Total posts:
519

Forum posts by Charles Bell:

35 pages [ Previous 1 ... 26 27 28 29 30 31 32 33 34 35 Next ]
Posted in Java Answers Forum, Apr 21, 2002, 12:56 PM
import java.awt.*;import java.awt.event.*;import java.util.StringTokenizer;import javax.swing.*;public class TextFieldTest extends JFrame implements ActionListener{ private JTextField number1Field; // used in both constructor and actionPerformed private JTextField number2Field; private JLabel resultLabel; public TextFieldTest(String title) {...
Posted in Java Answers Forum, Apr 20, 2002, 9:00 PM
Hey,also try the command setand it will list all your environment variables.One of these should be CLASSPATHPick out the line that starts with CLASSPATH=All the entries are separated with a semicolon ;and define how javac and java programs will find the class it needs.The entry that looks like ;.;stands for the cuurent working directoryThe...
Posted in Java Answers Forum, Apr 20, 2002, 8:52 PM
/* MessageDigestComputer.java* @author: Charles Bell* @version: Apr 20, 2002*/import java.applet.*;import java.awt.*;import java.awt.event.*;import java.io.*;import java.security.*;import javax.swing.*;/** Computes the Message Digest of the Text contained in the text area and displays it* in the TextField when the Compute button is clicked.*...
Posted in Java Answers Forum, Apr 20, 2002, 8:24 PM
Hello, I used that SimpleWebPageReader I just posted to navigate to the web site I am building using jsp's and used to it to fill out an email form and sent myself an email message.It's simple and does the job.
Posted in Java Answers Forum, Apr 20, 2002, 8:21 PM
/* SimpleWebPageReader.java* @author: Charles Bell * @version January 15 2001*/import java.awt.*;import java.io.*;import java.net.*;import javax.swing.*;import javax.swing.event.*;import javax.swing.text.*;public class SimpleWebPageReader implements HyperlinkListener{ JEditorPane editorpane; public static void main(String[] args){...
Posted in Java Answers Forum, Apr 20, 2002, 8:17 PM
import java.awt.*;import java.awt.event.*;import java.util.StringTokenizer;import javax.swing.*;public class TextFieldTest extends JFrame implements ActionListener{ private JTextField number1Field; // used in both constructor and actionPerformed private JTextField number2Field; private JLabel resultLabel; public TextFieldTest(String title) {...
Posted in Java Answers Forum, Apr 20, 2002, 7:50 PM
/* DESEncryption.java* @author: Charles Bell* @version: Feb 28, 2001*/import java.io.*;import java.security.*;import java.security.spec.*;import javax.crypto.*;import javax.crypto.interfaces.*;import javax.crypto.spec.*;import com.sun.crypto.provider.SunJCE; public class DESEncryption{ String message = "George W. Bush is the president of the...
Posted in Java Answers Forum, Apr 20, 2002, 5:01 PM
You might also try setting the size of your Panel with either the: setSize(Dimension d);or setSize(int width, int height);methods.If you panel is a JPanel or if using a JScrollPane, usesetPreferredSize(Dimension d);or setPreferredSize(new Dimension (int width, int height)); etc..
Posted in Java Answers Forum, Mar 23, 2002, 2:31 PM
the remove method is a Container method from whichPanel, and JPanel inherit from:removepublic void remove(Component?comp)Removes the specified component from this container.Parameters:comp - the component to be removed if your panel object is named controlArea as your code indicates, then try the...
Posted in Java Answers Forum, Mar 21, 2002, 4:31 PM
public void actionPerformed(ActionEvent ae){ if (ae.getActionCommand().compareTo("Next") == 0){ oldframe.setVisible(false); newframe.setVisible(true); }}or public void actionPerformed(ActionEvent ae){ if (ae.getActionCommand().compareTo("Next") == 0){ oldframe.dispose(); newframe.setVisible(true); }}
Posted in Java Answers Forum, Mar 21, 2002, 4:27 PM
/** Takes a String in the format 1h 2s 3h 10s jc qd, processes it into a vector of Card objects. */ public Vector sortString(String s){ Vector v = new Vector(); //assume string is in format 1h 2s 3h 10s jc qd StringTokenizer st = new StringTokenizer(s, " "); //assume space is separator while (st.hasMoreTokens){ String nextcardstring =...
Posted in Java Answers Forum, Mar 21, 2002, 3:58 PM
in your code you could use lines such as with the classes below it:HttpURLConnection connection = null;HttpURLConnection.setFollowRedirects(true);if (debug)System.out.println("Using normal connection");connection = getHttpURLConnection(urlstring);if (connection != null)System.out.println("Established connection");HTMLParser htmlparser = new...
Posted in Java Answers Forum, Mar 21, 2002, 3:47 PM
JComboBox does have an actionstring associated with it.You can either set it or get it withpublic void setActionCommand(String aCommand)orpublic String getActionCommand()In the hierarchy of classes, JComboBox does not inherit from JTextComponent:Class JComboBoxjava.lang.Object | +--java.awt.Component | +--java.awt.Container |...
Posted in Java Answers Forum, Mar 21, 2002, 3:38 PM
you need to either define a boolean variable called mouseIn in the method your code is in or declare it as a class variable if used other methods and you need a global reference.boolean mouseIn = false;or boolean mouseIn = true;
Posted in Java Answers Forum, Mar 20, 2002, 4:45 PM
The following code creates a jpeg image file file and writes text into it. You could adapt it to your problem or program./** CreateJPEG.java* @author Charles Bell* @version December 12, 2000*/import java.awt.*;import java.awt.event.*;import java.awt.image.*;import java.io.*;import com.sun.image.codec.jpeg.JPEGCodec;import...
35 pages [ Previous 1 ... 26 27 28 29 30 31 32 33 34 35 Next ]
Advertisement