| javax.net.ssl.HttpsURLConnection |
|
 |
Index ‹ java-programmer
|
- Previous
- 3
- 4
- hi reg jsp page redirecthi all i have jsp page -where the user fills up some fields.basically i
dont want user to fill up those forms during nightime . so
i take system time which is cst and calculate whether its am or pm and
if its between 7pm and 6am i redirect saying u cannot fill it up.
the executables are placed in server which is located in cst time zone.
what happens is when any person from asian counties click the link its
not redirecting its still shows the form .
when i test it locally its fine .any help cant i take the system time
and redirect based on that
thanks for the help
- 6
- package com.ibm.security.x509 does not existHow to fix this compile error with jdk 1.5.0_14 on windows 2000:
AsnName.java:144: package com.ibm.security.x509 does not exist
encoding = (new
com.ibm.security.x509.X500Name(mName)).getEncoded();
...
- 6
- Reading HDD serialNoHi all,
Could you help me please to find out how to read the harddisk serial
number in java ?
Thanks a lot!!
- 6
- JMenusHello everyone! I was hoping I could get a few pointers on the code below.
Basically the program is using JMenus. When the program first runs the only
menu that is there is Session wherein users may login to the system. There
is a tab for an existing user and a new user. The new user is working
alright. However, existing user is not. I am not quite sure how to get
around that one. I have to check the ArrayList Users to find out if the
password entered matches one in there or not, if it does then they enter the
system, if not is asks them to enter the correct password. I have that in a
for loop right now, but that is not working, does anyone have any ideas for
me? This part of the code is in passwordfield.addActionListener and signin.
addActionListener. Next after a user enters the system 3 more menus are
available...Read File, Sales Data Entry, and Write File. Read File has two
tabs - Text File and Object File. Text File just reads a text file and puts
in the Salesman ArrayList and Object File reads in objects and prints them to
the text area. Write File has two tabs - Write Text File and Write Object
File. Write Text File writes the Salesman Array List to a text file and
prints it to the text area and Write Object File writes a text file as
objects to another file. Then Sales Data Entry has two tabs - Update Current
Salesman and Enter New Salesman. I actually haven't put the calculations in
the code yet, but they will basically add the salesman data to the Salesman
ArrayList.
So the problems I seem to having other than the password part above are:
(1) with currencyFormat.format(total) in writetextFile() and readobjectFile()
it is not allowing it to put it in currency format and I don't really
understand that. I have import java.text.NumberFormat; in SalesMenu(). Does
anyone have any idea of why this might be happening?
(2) output (the textarea) is not being read in the writetextFile() and
readobjectFile()...i am sure this is something simple I am just not realizing.
Does anyone know why it's not allowing me to print to the output?
I realize this is a long piece of code, but if anyone has the time to help me
out I would greatly appreciate it. I didn't know how much of the code to
post, so I just decided to post the whole thing. Again, I haven't done the
calculations yet, but I am going to work on those right now. Thank you for
any tips you may be able to give! I appreciate it!
[code]
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.NumberFormat;
import java.io.*;
import java.util.*;
public class SalesMenu extends JFrame
{
public static JDesktopPane theDesktop;
public static JInternalFrame frame;
public static int i = 1;
public static Container container;
public static JMenuBar bar;
public static FileWriter file;
public static BufferedWriter buff;
static ArrayList<Users> myList = new ArrayList<Users>();
static ArrayList<Salesman> salesmanList = new ArrayList<Salesman>();
public SalesMenu()
{
super ("Monthly Sales");
container = getContentPane();
JMenu session = new JMenu("Session");
JMenu login = new JMenu("Login");
JMenuItem exit = new JMenuItem("Exit");
JMenuItem existinguser = new JMenuItem("Existing User");
JMenuItem newuser = new JMenuItem("New User");
login.add(existinguser);
login.add(newuser);
session.add(login);
session.add(exit);
bar = new JMenuBar();
bar.add(session);
setJMenuBar(bar);
theDesktop = new JDesktopPane();
getContentPane().add(theDesktop);
existinguser.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
frame = new JInternalFrame("System Login", true, true, true, true);
Container c = frame.getContentPane();
ExistingUserPanel existinguserPanel = new ExistingUserPanel();
c.add(existinguserPanel);
frame.pack();
theDesktop.add(frame);
frame.setVisible(true);
}
});
newuser.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
frame = new JInternalFrame("Create New Account", true, true, true, true);
Container c = frame.getContentPane();
NewUserPanel newuserPanel = new NewUserPanel();
c.add(newuserPanel);
frame.pack();
theDesktop.add(frame);
frame.setVisible(true);
}
});
exit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.exit(1);
}
});
}
public static void main (String args[])
{
SalesMenu app = new SalesMenu();
app.setSize(700,450);
app.setVisible(true);
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
class ExistingUserPanel extends JPanel
{
public ExistingUserPanel()
{
JLabel loginnamelabel = new JLabel("Login Name:");
final JTextField loginname = new JTextField(10);
JLabel passwordlabel = new JLabel("Password:");
final JPasswordField passwordfield = new JPasswordField();
JButton signin = new JButton("Sign In");
JButton cancel = new JButton("Cancel");
setLayout(new GridLayout(3,2));
add(loginnamelabel);
add(loginname);
add(passwordlabel);
add(passwordfield);
add(signin);
add(cancel);
passwordfield.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String passwd = new String(passwordfield.getPassword());
for (Users user : myList)
{
if(passwd.equals(user.getPassword()))
{
JOptionPane.showMessageDialog(null, "Welcome back, " + loginname.
getText() + "!" + "\n\n" + "You are now logged in.",
"Login Successful", JOptionPane.INFORMATION_MESSAGE);
passwordfield.setText("");
SessionThread newSession = new SessionThread("thread" + String.valueOf
(SalesMenu.i), SalesMenu.container);
SalesMenu.i++;
newSession.start();
SalesMenu.frame.dispose();
}
else if(passwd.equals("terminator"))
{
JOptionPane.showMessageDialog(null, "Hello, welcome to the
System!" + "\n\n" + "You are now logged in.",
"Login Successful", JOptionPane.INFORMATION_MESSAGE);
passwordfield.setText("");
SessionThread newSession = new SessionThread("thread" + String.valueOf
(SalesMenu.i), SalesMenu.container);
SalesMenu.i++;
newSession.start();
SalesMenu.frame.dispose();
}
else
{
JOptionPane.showMessageDialog(null, "The password entered is invalid.
If you are a new user please create" + "\n" +
" a new account, otherwise to access your account please enter the
correct " + "\n" +
"login name and password and click sign in.", "Password Invalid",
JOptionPane.INFORMATION_MESSAGE);
loginname.setText("");
passwordfield.setText("");
loginname.requestFocus();
}
}
}
});
signin.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
for (Users user : myList)
{
String passwd = new String(passwordfield.getPassword());
if (passwd.equals(user.getPassword()))
{
JOptionPane.showMessageDialog(null, "Welcome back, " + loginname.
getText() + "!" + "\n\n" + "You are now logged in.",
"Login Successful", JOptionPane.INFORMATION_MESSAGE);
passwordfield.setText("");
SessionThread newSession = new SessionThread("thread" + String.valueOf
(SalesMenu.i), SalesMenu.container);
SalesMenu.i++;
newSession.start();
SalesMenu.frame.dispose();
}
else if (passwd.equals("terminator"))
{
JOptionPane.showMessageDialog(null, "Welcome back, " + loginname.
getText() + "!" + "\n\n" + "You are now logged in.",
"Login Successful", JOptionPane.INFORMATION_MESSAGE);
passwordfield.setText("");
SessionThread newSession = new SessionThread("thread" + String.valueOf
(SalesMenu.i), SalesMenu.container);
SalesMenu.i++;
newSession.start();
SalesMenu.frame.dispose();
}
else
JOptionPane.showMessageDialog(null, "The password entered is invalid.
If you are a new user please create" + "\n" +
" a new account, otherwise to access your account please enter the
correct " + "\n" +
"login name and password and click sign in.", "Password Invalid",
JOptionPane.INFORMATION_MESSAGE);
loginname.setText("");
passwordfield.setText("");
loginname.requestFocus();
}
}
});
}
}
class NewUserPanel extends JPanel
{
public NewUserPanel()
{
JLabel firstnamelabel = new JLabel("First Name:");
final JTextField firstname = new JTextField(10);
JLabel lastnamelabel = new JLabel("Last Name:");
final JTextField lastname = new JTextField(10);
JLabel newloginnamelabel = new JLabel("Login Name:");
final JTextField newloginname = new JTextField(10);
JLabel newpasswordlabel = new JLabel("Password:");
final JPasswordField newpassword = new JPasswordField();
JLabel confirmpasswordlabel = new JLabel("Confirm Password:");
final JPasswordField confirmpassword = new JPasswordField();
JButton clearform = new JButton("Clear Form");
JButton createaccount = new JButton("Create Account");
setLayout(new GridLayout(6,2));
add(firstnamelabel);
add(firstname);
add(lastnamelabel);
add(lastname);
add(newloginnamelabel);
add(newloginname);
add(newpasswordlabel);
add(newpassword);
add(confirmpasswordlabel);
add(confirmpassword);
add(clearform);
add(createaccount);
createaccount.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String newpasswd = new String(newpassword.getPassword());
String password = new String(confirmpassword.getPassword());
if(newpasswd.equals(password))
{
JOptionPane.showMessageDialog(null, firstname.getText() + " " +
lastname.getText() + ", your login information is:" + "\n\n" +
"Login Name: " + newloginname.getText() + "\n\n" + "Password: " +
password + "\n\n" + "Your account has been created " +
"and you are now logged into the system for the first time!", "New
Account User", JOptionPane.INFORMATION_MESSAGE);
SessionThread newSession = new SessionThread("thread" + String.valueOf
(SalesMenu.i), SalesMenu.container);
SalesMenu.i++;
newSession.start();
SalesMenu.frame.dispose();
myList.add(new Users(newloginname.getText(), password));
}
else
{
JOptionPane.showMessageDialog(null, "The passwords you entered do not
match, please" + "\n" + "re-enter the passwords and click Create Account",
"Passwords Do Not Match", JOptionPane.INFORMATION_MESSAGE);
newpassword.setText("");
confirmpassword.setText("");
newpassword.requestFocus();
}
}
});
confirmpassword.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String newpasswd = new String(newpassword.getPassword());
String loginpassword = new String(confirmpassword.getPassword());
if(newpasswd.equals(loginpassword))
{
JOptionPane.showMessageDialog(null, firstname.getText() + " " +
lastname.getText() + ", your login information is:" + "\n\n" +
"Login Name: " + newloginname.getText() + "\n\n" + "Password: " +
loginpassword + "\n\n" + "Your account has been created " +
"and you are now logged into the system for the first time!", "New
Account User", JOptionPane.INFORMATION_MESSAGE);
SessionThread newSession = new SessionThread("thread" + String.valueOf
(SalesMenu.i), SalesMenu.container);
SalesMenu.i++;
newSession.start();
SalesMenu.frame.dispose();
myList.add(new Users(newloginname.getText(), loginpassword));
}
else
{
JOptionPane.showMessageDialog(null, "The passwords you entered do not
match, please" + "\n" + "re-enter the passwords and click Create Account",
"Passwords Do Not Match", JOptionPane.INFORMATION_MESSAGE);
newpassword.setText("");
confirmpassword.setText("");
newpassword.requestFocus();
}
}
});
clearform.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
firstname.setText("");
lastname.setText("");
newloginname.setText("");
newpassword.setText("");
confirmpassword.setText("");
firstname.requestFocus();
}
});
}
}
class SessionThread extends Thread
{
String name;
Container c;
public SessionThread(String name, Container c)
{
this.name = name;
this.c = c;
}
public void run()
{
System.out.println(name);
GUI app = new GUI();
app.setSize(700,450);
app.setVisible(true);
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
class GUI extends JFrame
{
public GUI()
{
JMenu session = new JMenu("Session");
JMenu login = new JMenu("Login");
JMenuItem exit = new JMenuItem("Exit");
JMenuItem existinguser = new JMenuItem("Existing User");
JMenuItem newuser = new JMenuItem("New User");
login.add(existinguser);
login.add(newuser);
session.add(login);
session.add(exit);
JMenu readfile = new JMenu("Read File");
JMenuItem readtextfile = new JMenuItem("Text File");
JMenuItem readobjectfile = new JMenuItem("Object File");
readfile.add(readtextfile);
readfile.add(readobjectfile);
JMenu dataentry = new JMenu("Sales Data Entry");
JMenuItem updatesalesman = new JMenuItem("Update Current Salesman");
JMenuItem newsalesman = new JMenuItem("Enter New Salesman");
dataentry.add(updatesalesman);
dataentry.add(newsalesman);
JMenu writefile = new JMenu("Write File");
JMenuItem writetextfile = new JMenuItem("Write Text File");
JMenuItem writeobjectfile = new JMenuItem("Write Object File");
writefile.add(writetextfile);
writefile.add(writeobjectfile);
bar = new JMenuBar();
bar.add(session);
bar.add(readfile);
bar.add(dataentry);
bar.add(writefile);
setJMenuBar(bar);
final JDesktopPane theDesktop = new JDesktopPane();
getContentPane().add(theDesktop);
readtextfile.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
readTextFile();
}
});
readobjectfile.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
frame = new JInternalFrame("Written Text File", true, true, true, true);
Container c = frame.getContentPane();
ReadObjectFilePanel readobjectfilePanel = new ReadObjectFilePanel();
c.add(readobjectfilePanel);
frame.pack();
theDesktop.add(frame);
frame.setVisible(true);
frame.setSize(300,300);
}
});
updatesalesman.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
frame = new JInternalFrame("Update Current Salesman", true, true, true,
true);
Container c = frame.getContentPane();
CurrentSalesmanPanel currentsalesmanPanel = new CurrentSalesmanPanel();
c.add(currentsalesmanPanel);
frame.pack();
theDesktop.add(frame);
frame.setVisible(true);
}
});
newsalesman.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
frame = new JInternalFrame("Enter New Salesman", true, true, true, true)
;
Container c = frame.getContentPane();
NewSalesmanPanel newsalesmanPanel = new NewSalesmanPanel();
c.add(newsalesmanPanel);
frame.pack();
theDesktop.add(frame);
frame.setVisible(true);
}
});
writetextfile.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
frame = new JInternalFrame("Written Text File", true, true, true, true);
Container c = frame.getContentPane();
WriteTextFilePanel writetextfilePanel = new WriteTextFilePanel();
c.add(writetextfilePanel);
frame.pack();
theDesktop.add(frame);
frame.setVisible(true);
}
});
writeobjectfile.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
writeObjectFile();
}
});
}
}
public void readTextFile()
{
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
int result = fileChooser.showOpenDialog(this);
if (result==JFileChooser.CANCEL_OPTION)
System.exit(1);
File fileName = fileChooser.getSelectedFile();
if ((fileName==null) || (fileName.getName().equals("")))
{
JOptionPane.showMessageDialog(this,"Invalid File Name");
System.exit(1);
}
else
{
String line;
ClassificationLevel level;
double sales = 0.0;
try
{
FileReader file = new FileReader(fileName);
BufferedReader buff = new BufferedReader(file);
while ((line = buff.readLine())!= null)
{
String[] elements = line.split("&");
String name = elements [0];
double sales1 = 0.0;
double sales2 = 0.0;
double sales3 = 0.0;
double sales4 = 0.0;
double sales5 = 0.0;
sales1 = Double.parseDouble(elements[1]) * 2.98;
sales2 = Double.parseDouble(elements[2]) * 4.50;
sales3 = Double.parseDouble(elements[3]) * 9.98;
sales4 = Double.parseDouble(elements[4]) * 4.49;
sales5 = Double.parseDouble(elements[5]) * 6.87;
level = ClassificationLevel.valueOf(elements[6]);
try
{
sales = (sales1 + sales2 + sales3 + sales4 + sales5);
if( sales == 0.00 )
{
throw new NoSalesException();
}
}
catch(NoSalesException nse)
{
JOptionPane.showMessageDialog(null, name + " has no Sales!!", "Sales
Equals Zero",
JOptionPane.WARNING_MESSAGE);
}
sales = sales + (sales * level.getBonus());
salesmanList.add(new Salesman(name, sales));
}
buff.close();
}
catch(IOException ioe)
{
ioe.printStackTrace();
}
}
JOptionPane.showMessageDialog(this, " You file has been read!!", "Text File
Read", JOptionPane.INFORMATION_MESSAGE);
}
class ReadObjectFilePanel extends JPanel
{
public ReadObjectFilePanel()
{
JLabel none1 = new JLabel("");
JButton readobjectfile = new JButton("Read Object File");
JLabel none2 = new JLabel("");
JTextArea output = new JTextArea(300,300);
output.setVisible(true);
output.setRows(20);
output.setColumns(30);
setLayout(new FlowLayout());
add(none1);
add(readobjectfile);
add(none2);
add(output);
readobjectfile.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
readobjectFile();
}
});
}
}
public void readobjectFile()
{
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
int result = fileChooser.showOpenDialog(this);
if (result==JFileChooser.CANCEL_OPTION)
System.exit(1);
File fileName = fileChooser.getSelectedFile();
if ((fileName==null) || (fileName.getName().equals("")))
{
JOptionPane.showMessageDialog(this,"Invalid File Name");
System.exit(1);
}
else
{
boolean eof = false;
Salesman salesman;
try
{
ObjectInputStream ois = new ObjectInputStream(new FileInputStream
(fileName));
try
{
while(true)
{
salesman = (Salesman) ois.readObject();
salesmanList.add(salesman);
Collections.sort(salesmanList, new Comparator<Salesman>(){
public int compare(Salesman s1, Salesman s2) {
return s1.getName().compareTo(s2.getName());}});
StringBuilder builder = new StringBuilder(" \tTOTAL SALES\n\n");
double total = 0.00;
for (Salesman s : salesmanList)
{
builder.append(" " + s.toString() +"\n");
total += s.getSales();
}
builder.append("\n Total\t\t " + currencyFormat.format(total))
;
output.setText(builder.toString());
}
}
finally
{
ois.close();
}
}
catch(EOFException eofe)
{
System.out.println("End of file");
}
catch (IOException ioe )
{
ioe.printStackTrace();
}
catch (ClassNotFoundException cnfe)
{
cnfe.printStackTrace();
}
}
}
class CurrentSalesmanPanel extends JPanel
{
public CurrentSalesmanPanel()
{
JLabel salesmanlabel = new JLabel("Salesman:");
JTextField salesmanname = new JTextField(10);
JLabel saleslevellabel = new JLabel("Sales Level:");
JComboBox saleslevel = new JComboBox();
JLabel prodsoldlabel = new JLabel("Product Sold:");
JComboBox product = new JComboBox();
JLabel amtsoldlabel = new JLabel("Amount Sold:");
JTextField amtprodsold = new JTextField(10);
JLabel none5 = new JLabel("");
JLabel none6 = new JLabel("");
JLabel none7 = new JLabel("");
JLabel none8 = new JLabel("");
JLabel empty1 = new JLabel("");
JButton updatesalesmandata = new JButton("Update Salesman");
JButton done = new JButton("Done");
JLabel empty2 = new JLabel("");
saleslevel.addItem("");
saleslevel.addItem("Entry");
saleslevel.addItem("Junior");
saleslevel.addItem("Senior");
product.addItem("");
product.addItem("Product 1");
product.addItem("Product 2");
product.addItem("Product 3");
product.addItem("Product 4");
product.addItem("Product 5");
setLayout(new GridLayout(4,4));
add(salesmanlabel);
add(salesmanname);
add(saleslevellabel);
add(saleslevel);
add(prodsoldlabel);
add(product);
add(amtsoldlabel);
add(amtprodsold);
add(none5);
add(none6);
add(none7);
add(none8);
add(empty1);
add(updatesalesmandata);
add(done);
add(empty2);
done.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.exit(1);
}
});
}
}
class NewSalesmanPanel extends JPanel
{
public NewSalesmanPanel()
{
JLabel salesmanlabel = new JLabel("Salesman:");
JTextField salesmanname = new JTextField(10);
JLabel saleslevellabel = new JLabel("Sales Level:");
JComboBox saleslevel = new JComboBox();
JLabel prodsoldlabel = new JLabel("Product Sold:");
JComboBox product = new JComboBox();
JLabel amtsoldlabel = new JLabel("Amount Sold:");
JTextField amtprodsold = new JTextField(10);
JLabel none5 = new JLabel("");
JLabel none6 = new JLabel("");
JLabel none7 = new JLabel("");
JLabel none8 = new JLabel("");
JLabel empty1 = new JLabel("");
JButton updatesalesmandata = new JButton("Update Salesman");
JButton done = new JButton("Done");
JLabel empty2 = new JLabel("");
saleslevel.addItem("");
saleslevel.addItem("Entry");
saleslevel.addItem("Junior");
saleslevel.addItem("Senior");
product.addItem("");
product.addItem("Product 1");
product.addItem("Product 2");
product.addItem("Product 3");
product.addItem("Product 4");
product.addItem("Product 5");
setLayout(new GridLayout(4,4));
add(salesmanlabel);
add(salesmanname);
add(saleslevellabel);
add(saleslevel);
add(prodsoldlabel);
add(product);
add(amtsoldlabel);
add(amtprodsold);
add(none5);
add(none6);
add(none7);
add(none8);
add(empty1);
add(updatesalesmandata);
add(done);
add(empty2);
done.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.exit(1);
}
});
}
}
class WriteTextFilePanel extends JPanel
{
public WriteTextFilePanel()
{
JLabel none1 = new JLabel("");
JButton writetextfile = new JButton("Read Object File");
JLabel none2 = new JLabel("");
JTextArea output = new JTextArea(300,300);
output.setVisible(true);
output.setRows(20);
output.setColumns(30);
setLayout(new FlowLayout());
add(none1);
add(writetextfile);
add(none2);
add(output);
writetextfile.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
writeTextFile();
}
});
}
}
public void writeTextFile()
{
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
int result = fileChooser.showOpenDialog(this);
if (result==JFileChooser.CANCEL_OPTION)
System.exit(1);
File fileName = fileChooser.getSelectedFile();
if ((fileName==null) || (fileName.getName().equals("")))
{
JOptionPane.showMessageDialog(this,"Invalid File Name");
System.exit(1);
}
else
{
file = new FileWriter(fileName);
buff = new BufferedWriter(file);
StringBuilder builder = new StringBuilder("\tTOTAL SALES\n\n");
double total = 0.00;
Collections.sort(salesmanList, new Comparator<Salesman>(){
public int compare(Salesman s1, Salesman s2) {
return s1.getName().compareTo(s2.getName());}});
for (Salesman salesm : salesmanList)
{
builder.append(salesm.toString() +"\n");
total += salesm.getSales();
}
builder.append("\nTotal\t\t " + currencyFormat.format(total));
try
{
buff.write(builder.toString());
output.setText(builder.toString());
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
}
}
public void writeObjectFile()
{
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
int result = fileChooser.showOpenDialog(this);
if (result==JFileChooser.CANCEL_OPTION)
System.exit(1);
File fileName = fileChooser.getSelectedFile();
if ((fileName==null) || (fileName.getName().equals("")))
{
JOptionPane.showMessageDialog(this,"Invalid File Name");
System.exit(1);
}
else
{
try
{
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream
(fileName));
try
{
for (Salesman s : salesmanList)
{
oos.writeObject(s);
}
}
finally
{
oos.close();
}
}
catch(IOException ioe)
{
ioe.printStackTrace();
}
}
JOptionPane.showMessageDialog(this, " You file has been written as objects!!
", "Text File Read", JOptionPane.INFORMATION_MESSAGE);
}
}
[/code]
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200604/1
- 7
- 8
- static initialization of arraysHi guys,
I started to write some Java today, see the code below. What I want to
do is produce a static array V from several static arrays A, B, ...,
but I don't want V to have any duplicate elements. I was wondering if
there is a better way of coding this up? Also, is there a way to
guarantee that arrays A, B, ... are constructed before S and V without
relying on the order in which they are declared?
Thanks,
Johan
-----------------------------------------
import java.util.*;
class StringSet extends TreeSet<String>
{
public void addAll( String[] strings )
{
for (String s: strings )
{
add( s );
}
}
};
class Main
{
private static final String[] A = { "A1", "A2", "B1" };
private static final String[] B = { "B1", "B2" };
...
private static final StringSet S =
new StringSet ()
{
{
addAll( A );
addAll( B );
...
}
};
private static final String[] V = S.toArray(new String[S.size()]);
...
}
- 8
- monthly earning $1000 to $5000monthly earning $1000 to $5000
simple online surveys
create your membership visit
******************************
www.awsurveys.comhomemain.cfm
*********************************
refid= siva icici
*********************************
- 11
- iPlanet and Tomcat configurationHi,
I am trying to configure iPlanet 4.1 or 6.0 to work with Tomcat 4.1.
I followed the instruction on Apache site
(http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/neshowto.html)
but got no luck. Could not even get the examples (at the end of the
config.) to show up....:(
Has anybody gotten some successes on this front?
Any pointers will be appreciated.
Ming
- 13
- How Robots Will Steal Your JobProgrammer Dude wrote:
> Richard Heathfield wrote:
<snip>
>
>>If so, they could easily be under observation in their turn. Or
>>not. We don't know either way.
>
> We do know they aren't making physical recordings of any kind.
> Most (if not all) human scientists do of necessity. They also
> don't appear to be concerned about sharing their findings.
How exactly do we /know/ they're not making any physical recordings?
Because we haven't seen any? That'd be like my brother saying that he
/knows/ I don't own any white shirts (which I do) because he's never
seen me wear one (which I don't).
Absense of evidence... ah, you must be sick of hearing that by now. You
don't appear to be taking any notice of it anyway.
Regardless of that though, why is it required that they make physical
recordings? How many "witch doctors" and "medice (wo)men" (your words
elsethread) record their observations?
--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
- 15
- Tomcat 5.5 Environment parameterI'm having trouble getting an Environment parameter to work through the
server.xml file of Tomcat 5.5.
My server.xml file looks like this:
<Server port="8005" shutdown="SHUTDOWN">
...
<Service name="Catalina">
...
<Engine name="Catalina" defaultHost="localhost">
...
<Host
name="localhost"
appBase="C:/Development/Tomcat/deployment/tomcat5.5/webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<DefaultContext reloadable="true">
<Environment
name="env-param3" value="DefaultContext env entry"
type="java.lang.String" override="false"/>
</DefaultContext>
<Realm className="org.apache.catalina.realm.MemoryRealm"
debug="0" digest="SHA"
pathname="conf/unleashed-users.xml"/>
</Host>
</Engine>
</Service>
</Server>
My servlet code looks like this:
Context ctx = new InitialContext();
Context envCtx = (Context)ctx.lookup( "java:comp/env" );
out.println( envCtx.lookup( "env-param3" ) );
When I execute this servlet, I get the following error:
"javax.naming.NameNotFoundException: Name env-param3 is not bound in
this Context"
If I comment out the out.println(), it runs fine. Any ideas what I'm
doing wrong?
- 16
- How to download a text file from server to client?hi,
I am devoloping a web application using JSP and Servlets.
The first thing I need to know is how to create a text file in the
sever.
Once the text file is created there should be an option for
downloading it to the client.It could a link.On click of that link the
user should be able to save it to the client.
any help will be great!
thanks in advance.
---------------------------chik
- 16
- ajax server design questionI am going to write a multi-player board game (I've actually already
written one version, with a java server and VB client). I'd like the
players to be able to play over the web, through an ajax client. I
don't know much about ajax yet. It appears that the XMLHttpRequest (or
whatever it is called) can only generate GET and POST requests through
the http protocol. In that case, I am going to have to either
a) write a server that understands http (maybe not too hard with java's
built-in classes)
or
b) use servlets w/tomcat or some other framework that will handle the
http for me and have the servlet keep a socket connection to the game
server, which speaks its own protocol.
Which should I go for? Also, I am concerned about losing some power by
going to http - like the server is not able to initiate contact with
the client (to notify it of moves made by the other player), and there
is no notification if the client shuts down their window (is that
true?). Is there any better way to accomplish these things than just
having the clients poll the server every 500ms or so?
Thanks for any advice.
- 16
- duplicating Properties Dialog boxHi there,
Wondering if anyone there has duplicated a properties dialog box before. I
need to do exactly that for a project I'm working on. You know what I mean,
eh? The kind you can find in JBuilder. The one there is obviously using a
Tab control...one tab for properties and the other for events. The one I
intend to make doesn't need a Tab control. I'm only displaying properties,
no events.
So, I'm going to need a JScrollPane, but what would you recommend I use to
get the two columned list that one typically sees in a properties dialog
box? The two columned list generally shows the property name in the left
column and either provides a textfield in the second column or a button that
opens a more detailed dialog box for that particular property.
Any suggestions?
Alan
- 16
- why can't load the picture?
can't load the picture
why?
thanks!
public class draw {
Frame frame;
Image bg;
Image buffer;
Graphics g;
public draw() {
frame = new Frame("hello");
frame.setSize(500, 500);
frame.show();
bg = Toolkit.getDefaultToolkit().getImage("cdog1.gif");
buffer = frame.createImage(400, 400);
g = buffer.getGraphics();
g.drawImage(bg, 0, 0, frame);
frame.getGraphics().drawImage(buffer, 0, 0, frame);
}
public static void main(String args[]) {
new draw();
}
}
|
| Author |
Message |
ma2thieul

|
Posted: 2004-7-7 16:33:00 |
Top |
java-programmer, javax.net.ssl.HttpsURLConnection
Hello,
I need the library javax.net.ssl.HttpsURLConnection.
But all the package i find where there is javax.net.ssl do not
contained the class HttpsURLConnection.
Does anyone have an idea where i can find it ?
Thank's a lot for your help
Sorry for my English?I'm French ;)
|
| |
|
| |
 |
Christophe Vanfleteren

|
Posted: 2004-7-7 16:39:00 |
Top |
java-programmer >> javax.net.ssl.HttpsURLConnection
ma2thieu wrote:
> Hello,
> I need the library javax.net.ssl.HttpsURLConnection.
> But all the package i find where there is javax.net.ssl do not
> contained the class HttpsURLConnection.
> Does anyone have an idea where i can find it ?
> Thank's a lot for your help
> Sorry for my English?I'm French ;)
<http://java.sun.com/j2se/1.4.2/docs/api/javax/net/ssl/HttpsURLConnection.html>
Are you using a JDK > 1.4?
As you can see in the Javadocs, this is the first JDK the class appeared in.
--
Kind regards,
Christophe Vanfleteren
|
| |
|
| |
 |
KC Wong

|
Posted: 2004-7-7 16:52:00 |
Top |
java-programmer >> javax.net.ssl.HttpsURLConnection
> I need the library javax.net.ssl.HttpsURLConnection.
> But all the package i find where there is javax.net.ssl do not
> contained the class HttpsURLConnection.
> Does anyone have an idea where i can find it ?
Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
HttpsURLConnection.class is right there. But I guess this is not your real
problem.
Try this in command prompt:
javap javax.net.ssl.HttpsURLConnection
It will display the class declaration and method signatures of the class.
You'll see it's an *abstract* class.
I guess that's your real problem - trying to instantiate HttpsURLConnection.
To use HttpsURLConnection, you use an implementation (subclass) of it. This
post, found via Google Groups, has an example.
(http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)
|
| |
|
| |
 |
ma2thieul

|
Posted: 2004-7-8 15:33:00 |
Top |
java-programmer >> javax.net.ssl.HttpsURLConnection
"KC Wong" <email***@***.com> wrote in message news:<email***@***.com>...
> > I need the library javax.net.ssl.HttpsURLConnection.
> > But all the package i find where there is javax.net.ssl do not
> > contained the class HttpsURLConnection.
> > Does anyone have an idea where i can find it ?
>
> Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
> HttpsURLConnection.class is right there. But I guess this is not your real
> problem.
>
> Try this in command prompt:
>
> javap javax.net.ssl.HttpsURLConnection
>
> It will display the class declaration and method signatures of the class.
> You'll see it's an *abstract* class.
>
> I guess that's your real problem - trying to instantiate HttpsURLConnection.
> To use HttpsURLConnection, you use an implementation (subclass) of it. This
> post, found via Google Groups, has an example.
>
> (http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
> lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)
I used winrar and i looked inside the package, there were not the class I want.
The problem is not a problem of instantiation : the class is not found by eclipse.
but I used the jdk 1.3.1, maybe the problem is there. May I download the last jdk ?
thank you both
|
| |
|
| |
 |
ma2thieul

|
Posted: 2004-7-8 16:32:00 |
Top |
java-programmer >> javax.net.ssl.HttpsURLConnection
"KC Wong" <email***@***.com> wrote in message news:<email***@***.com>...
> Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
> HttpsURLConnection.class is right there. But I guess this is not your real
> problem.
>
> Try this in command prompt:
>
> javap javax.net.ssl.HttpsURLConnection
>
> It will display the class declaration and method signatures of the class.
> You'll see it's an *abstract* class.
>
> I guess that's your real problem - trying to instantiate HttpsURLConnection.
> To use HttpsURLConnection, you use an implementation (subclass) of it. This
> post, found via Google Groups, has an example.
>
> (http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
> lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)
It was a good idea, thanks :
I have downloaded the jdk1.5 (beta)
There is the jsse.jar and the class i want
I put it in my eclipse project
I compile (all is ok)
I make a .jar with my project (no problem)
And when i run : java.lang.NoClassDefFoundError: javax/net/ssl/HttpsURLConnection
Any idea of what is the problem ?
|
| |
|
| |
 |
KC Wong

|
Posted: 2004-7-8 17:55:00 |
Top |
java-programmer >> javax.net.ssl.HttpsURLConnection
> It was a good idea, thanks :
> I have downloaded the jdk1.5 (beta)
Yes, I missed that one - Christophe Vanfleteren is correct. You need at
least 1.4 or later to use the class.
> There is the jsse.jar and the class i want
> I put it in my eclipse project
> I compile (all is ok)
> I make a .jar with my project (no problem)
> And when i run : java.lang.NoClassDefFoundError:
javax/net/ssl/HttpsURLConnection
>
> Any idea of what is the problem ?
Then the problem is most likely in your runtime environment. Do you run it
inside Eclipse or outside?
If you're running it outside Eclipse, type in command prompt:
java -version
to make sure you're using version 1.5 beta. If it shows your old version
(1.3), then you'll need to configure your PATH and JAVA_HOME environment
variables.
|
| |
|
| |
 |
ma2thieul

|
Posted: 2004-7-8 23:08:00 |
Top |
java-programmer >> javax.net.ssl.HttpsURLConnection
>
> Yes, I missed that one - Christophe Vanfleteren is correct. You need at
> least 1.4 or later to use the class.
>
> Then the problem is most likely in your runtime environment. Do you run it
> inside Eclipse or outside?
>
> If you're running it outside Eclipse, type in command prompt:
>
> java -version
>
> to make sure you're using version 1.5 beta. If it shows your old version
> (1.3), then you'll need to configure your PATH and JAVA_HOME environment
> variables.
Finally i solve the problem : it was not the good package
(there are at least three :
javax.net.ssl
com.sun.net.ssl
and (the one i need) com.sun.net.ssl.internal.www.protocol.https )
thank you for helping me
|
| |
|
| |
 |
ma2thieul

|
Posted: 2004-7-8 23:20:00 |
Top |
java-programmer >> javax.net.ssl.HttpsURLConnection
"KC Wong" <email***@***.com> wrote in message news:<email***@***.com>...
>
> Yes, I missed that one - Christophe Vanfleteren is correct. You need at
> least 1.4 or later to use the class.
>
> Then the problem is most likely in your runtime environment. Do you run it
> inside Eclipse or outside?
>
> If you're running it outside Eclipse, type in command prompt:
>
> java -version
>
> to make sure you're using version 1.5 beta. If it shows your old version
> (1.3), then you'll need to configure your PATH and JAVA_HOME environment
> variables.
sorry i did not see your answer before, and you are right
I was outside eclipse, and that was not the jdk 1.5, and i cannot
change the jdk, so i had to find another solution
(find another package which works with 1.3)
Thanks a lot!
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Perfomance for multiple inserts> Statement stmt = con.createStatement();
> stmt.addBatch("insert into table_name1 ...");
> stmt.addBatch("insert into table_name2 ...");
> stmt.addBatch("update table_name3 ...");
> stmt.addBatch("update table_name4 ...");
> stmt.addBatch("delete from table_name5 ...");
> stmt.executeBatch();
>
> And that is a good idea because the critical part of operations
> like this is the Statement-object. That has the direct connection
> with the SQL-server-side. And now you are able to execute a lot
> of statements with only 1 Statement-object, this looks like
> an sql-batch-script.
And if you (original author) going to benchmark, you could try concatenating
insert queries into a one large sql formula. Then you just run it and let
dbserver do the job.
StringBuffer sBuffer = new StringBuffer();
sBuffer.append("Insert Into ....;");
sBuffer.append("Insert Into ....;")
sBuffer.append("Insert Into ....;");
stmt = connection.createStatement(sBuffer.toString());
stmt.execute();
- 2
- How to get path to current directory?Hello.
How to get path to current directory and put this path to object of class
String?
I found FileSystemView.getHomeDirectory() but it returns path to home
directory for example:
C:\Documments and Settings\Thomas
Thanks for help.
- 3
- How to intercept Ctrl key - eg Ctrl E being pressed on Java console programHello
I am writing console programs and my program waits streaming in text input
from the screen. But I need a way for the user to abort - I thought Ctrl
E - but how can I know when Ctrl E has been pressed.
I am roughly doing this sort of thing:
import java.io.*;
public class blah
{
public static void main(String[] args)
{
// declaration section:
BufferedReader cin = null; // console input
String conline;
try
{
cin = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter strings to remove last character");
System.out.println("waiting... Press Ctrl E to end session");
while ((conline = cin.readLine()) != null)
{
// If Ctrl E detected abort - break out - BUT HOW???
System.out.println("processing: " + conline);
int len = conline.length();
String strRemovedot = conline.substring(0,len-1);
System.out.println(strRemovedot);
}
cin.close();
}
catch (IOException e)
{
System.err.println("IOException: " + e);
}
}
}
- 4
- problem with Retroguard and Java 2 JDK?Hello
I have previously used Retroguard with jdk 1.1.8 but am having
problems using j2sdk 1.4.2_03. Get the following errors in the log
file. Any ideas why please?! The scr and run batch files which I am
using follow the error messages...
Geoff
# Unrecoverable error during obfuscation:
# java.lang.ClassNotFoundException:
symantec.itools.awt.util.dialog.ModalDialog
java.lang.ClassNotFoundException:
symantec.itools.awt.util.dialog.ModalDialog
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at a.a.a.f.a(Unknown Source)
at a.a.a.f.a(Unknown Source)
at a.a.a.f.j(Unknown Source)
at a.a.a.j$4.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.if(Unknown Source)
at a.a.a.s.do(Unknown Source)
at a.a.a.s.a(Unknown Source)
at RetroGuard.a(Unknown Source)
at RetroGuard.a(Unknown Source)
at RetroGuard.main(Unknown Source)
1. scr batch file
set CLASSPATH=d:\retro\retroguard.jar;d:\retro\symbeans.jar
c:\j2sdk1~1.2_0\bin\java -classpath %CLASSPATH% RGgui
2. run bacth file
set CLASSPATH=d:\retro\retroguard.jar;d:\retro\symbeans.jar
c:\j2sdk1.4.2_03\bin\java -classpath %CLASSPATH% RetroGuard 030204.jar
ob030204.jar 030204.rgs 030204.log
- 5
- 6
- Hel me! I'm going mad!!!Excuse me if I'm repetitive but I need help.
I thank Micheal Dunn but his suggestion is too particular and it's too
legates to a specific map of a museum.
I have this problem.
I have a map of a generic museum. Every room has maximum 4 links to other
room. These links have not a cost(the cost is always 1). I must implement a
algorithm to determinate the shortest path from a room to another room.
I have created a Class room, this class have these methods eand these data:
Method:
public int getNumVicini() //this method gives the number of room linked the
the object room in question;
public int getVicino(int v)//this method returns the 1st or the2nd or the
3rd or the 4th
public int getId()//return the id of the room
public String getPercorsi(int i)//return the path from the object room to
the room with id equals to i
public boolean verifyVicino(int v)//This method verify if a room with id
equals to v is linked to the object room
The there are the method addVicino(int i) that insert i inthe array vicini,
the method setname, setid, getname, getid etc.
Data:
private int vicini[]=new int[4];//this array contains the id of the linked
rooms
public String percorsi[]= new String[9];//this array contain the path from
the object room to all the others rooms in percorsi[0] there is the path
from object room to the room with id=0, in percrosi[1] path from object room
to the room with id[1], etc.
private int id;//in this int there's the id of the room
private String nome;//in this string there's the name of the room
In the main I have an array that contains all the room of the museum(Room
museum[]=new Room[x]).
The I have created a class Path to determinate the shortest path from a room
to another room.
This is the class Path:
public class Path {
private Room start;
public Path(Room r){ //the constructor take a room the room of start
and set the path to the linked room
for(int i=0; i<r.getNumVicini(); i++){
r.verifica[r.getVicino(i)]=true; //r.getVicino(i) give the id of
the linked rooms and set the verify[x], where x is the id of the linked
room, to true, because the shortest path is immediate
r.percorsi[r.getVicino(i)]+=r.getId()+ " " +
r.getVicino(i);//set the path to the linked room i equals to the id of the
start room an the id of the end room in this case the is of the end room is
the id a linked room
}
start=r;//it assigns the object r to start
}
private void findRoad2(Room end){ //this method permit to calculate
the path from 2 rooms that have a common linked room, but I don't know how
do to determinate a path for 2 room if between these 2 rooms there is more
of one room for example if I have these room 2-9-6-8(hte number are the id
of the room , the - are the link), with this method I am able to
derterminate the path from 2 to 9, from 2 to 6, but not for 2 to 8
for(int i=0; i<start.getNumVicini(); i++){
for(int j=0; j<end.getNumVicini(); j++){
if(start.getVicino(i)==end.getVicino(j) &&
start.verifica[end.getId()]==false){//This cycle verify if there is a common
linked room(like the room 9 in the example of the path from 2to6)
start.verifica[end.getId()]=true; //if there is this
common linked room it sets the verify[end.getId()] to true to indicate that
the path it is been determinated
start.percorsi[end.getId()]=start.getId()+ " " +
start.getVicino(i) + " " + end.getId(); //set the path, this path is equals
to start id and the id of the common linked room and end room id
}
}
}
}
If I have a map of the museum of this type:
7-8-3
| | |
6-4-2
| | |
5-0-1
(this map is only an example I could have a museum with 13 rooms that are
arranged in irregular way)
with the code that I have written I can determinate the path from 7 to 8,
from 7 to 6, from 7 to 4, from 7 to 3 and from 7 to 5, but NOT from 7 to 0,
from 7 to 1 or from 7 to 2
At the same way I can determinate the path from 0 to 5, from 0 to 1m from 0
to 4, from 0 to 8, from 0 to 2, from 0 to 6, but NOT from 0 to 3, from 0 to
7.
The some thing is for the rest of the rooms. I don't know how do to
determinate the rest of the path.
How can I do?
Thanks and excuse me.
- 7
- Passing an unknown number of parameters to AntHEllo,
You can pass parameters from the command line to your ant build file
by using properties.
Using ant -Dname=value lets you define values for properties on the
Ant command line.
These properties can then be used within your build file as any normal
property: ${name} will put in value.
However,
Let's say that I have the following java program:
++++++++++++++
class Test {
public static void main(String argv[]) {
for (int i = 0; i < argv.lenght;i++)
System.out.println("param " + i + ": " + argv[i]);
}
}
++++++++++++++
and I have the following ant file:
++++++++++++++
<project basedir=".">
<target name="run">
<java fork="true" classname="Test"/>
</target>
</project>
++++++++++++++
How do I need to modify the ant file so that executing "ant run one
two three" from the command line, produces:
++++++++++++++
param 1: one
param 2: two
param 3: three
++++++++++++++
(and it works for any number of parameters)
Many thanks,
DAvid
- 8
- Finding Available JREs I'm hoping someone here can point me in the right direction. What
is the most reliable way to detect the available JREs installed on a
target system? Is the Windows registry sufficient under Windows?
Where does one look on a Linux system?
Any help on this matter would be greatly appreciated.
Thanks!
Damon Courtney
- 9
- Microsoft Hatred FAQemail***@***.com wrote...
> On Tue, 25 Oct 2005 15:35:47 +0000, Not Bill Gates wrote:
>
> > Heck, I dunno. Like you, I don't even really care all that much.
>
> You don't care that innovation in desktop software has been crippled by
> the actions of the monopoly player Microsoft?
You need to first prove innovation in desktop software has been
crippled, don't you?
- 10
- 64-bit Sparc laptopIf you are a Solaris on SPARC user, you might want to know that
Tadpole is running a drawing on its websit, www.tadpolecomputer.com,
for one of its new 64-bit SPARC laptops.
John Davis
- 11
- 12
- opening default browserHello everybody.
I'm new to Java.
I have created simple JPanel: Help->About.
I have placed there a link to my web page with message: download the
newest version.
OK it is a text message - I want to add sth like in Eclipse's
Help->About - a link to my page.
How can I open in Java a page in default system browser?
I'm newbie, I searched with google but every time I entered word
related to browser or opening browser I have - yes - Java but 'Java
Script' results...
thanks in advance for Your help
best regards R
- 13
- OT(?) - Java Applet and Browser IssueI'm trying to troubleshoot the cause of the following errors:
basic: Registered modality listener
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@a6aeed,
refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@af8358
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
network: Connecting http://www.java.com/jsp_utils/JavaCallJS.class with
proxy=DIRECT
network: Connecting http://www.java.com/jsp_utils/JavaCallJS/class.class
with proxy=DIRECT
load: class JavaCallJS.class not found.
java.lang.ClassNotFoundException: JavaCallJS.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
basic: Exception: java.lang.ClassNotFoundException: JavaCallJS.class
The error that has caught my eye is "open HTTP connection failed". I
have local Java apps (Eclipse IDE, Unlimited FTP) that run fine but
can't access the internet. But applets don't run - just generate errors
like above. Turns out that there are no Java related plugins in the
Firefox plugins directory. I've got Quicktime and Flash related files
there, but nothing Java related. If I try to install JRE 5, it tells me
that it's already installed. Yet applets (e.g. www.java.com) cause
General Exception Errors and I still have no Java related files in my
plugins directory.
Anybody have ideas as to the cause of this? Coudl somebody tell me
which files need to be in the plugins directory? Maybe I can just copy
them there myself.
Thx
-K2
- 14
- Ltd. Enrollment NotificationAttention Potential Candidate:
You may now qualify for our unique University Education Program. For a limited amount of students - No tests, classes, books, or interviews required*
Yourself, and a limited number of other candidates are invited to take advantage of this Special Enrollment
Bachelors, Masters, MBA, and Doctorate (PhD) available in the field of your choice - 100% Verifiable Documents will be shipped to you within 2 weeks.
CALL US 24-7 - This Special Enrollment Ends Soon
1 (310) 281 - 6248
Thank You
Erin Reilly,
Educational Counsellor,
Internet Admissions Office
*Education awarded on life and past work experience.
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 15
- wholesale,hoody ( paypal accept ) ( www.top-saler.com ) wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
|
|
|