Jess Ishasder

Greenhorn
+ Follow
since Feb 19, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jess Ishasder

Hi. . I know package is used to group a collection of classes, but I got a
problem.
I saved the two classess as follows:
D:\JavaProgram\demo\myexercise\A.java
D:\JavaProgram\demo\myexercise\B.java
Program codes:
===============
package demo.myexercise;
public class A
{
String s;
public A()
{
s = "Hello";
}
public void getNum()
{
System.out.println(s);
}
}
==============
package demo.myexercise;
public class B
{
public static void main(String[] args)
{
A mya = new A();
mya.getNum();
}
}
Compiled A.java, no problem. but I got a problem when compiled B.java, it
said cannot resolve symbol...."A mya = new A()".
Why? Both A.java and B.java are saved under the same directory. Why B can't
call A?
What should I do if both A and B must be saved under the same directory?
Thanks.
21 years ago
suria,
Can you tell me where you downloaded Visibroker?
I've checked it out in borland.com, but it is a trial version, not free for download.
Also, which version of Visibroker are you using?
I found an Enterprise Server Visibroker Edition in borland.com. Is there any difference with the usual one?
I'm a newbie of Corba and I appreciate with your help.
Thank you.
21 years ago
Musthafa, thank you for your advice.
I checked it out in borland.com.
Do you suggest me to use "Borland Enterprise Server, VisiBroker Edition" ? But it is a trial download and only be used for 60 days.
Can you tell me more?
21 years ago
Hi! I'm a new learner of CORBA.
Can any of you recommend a free and good ORB for JAVA?
Thank you.
21 years ago
Hi. I got a problem about installation of Tomcat.
I've downloaded jarkarta-tomcat-4.0.4.zip and extracted it at C:\
I edited C:\autoexec.bat as follows:
SET CATALINA_HOME=C:\jakarta-tomcat-4.0.4
SET JAVA_HOME=C:\J2SDK1.4.0_01
SET CLASSPATH=C:\jakarta-tomcat-4.0.4\common\lib\servlet.jar;
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\J2SDK1.4.0_01\BIN
I'm using ME.
However, I can't startup the Tomcat.
Whenever I typed C:\jarkarta-tomcat-4.0.4\bin\startup, it got an error
message saying that "The CATALINA_HOME environment variable is not defined
correctly.This environment variable is needed to run this program."
Is it wrong about my settings?
Also, is jarkarta-tomcat-4.0.4.exe functioning same as
jarkarta-tomcat-4.0.4.zip?
Thank you for your help!
21 years ago
I can't get any code returned, only an exception is caught!!!
The following is part of my program:
===============
try{
HttpURLConnection con = (HttpURLConnection) (new URL("http://www.healthnet.org.np/java/msg00519.html")).openConnection();
con.setRequestMethod("GET");
if (con.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND){
System.out.println("File Not Found");
}
else{
System.out.println("code : " + con.getResponseCode());
}
}
catch(FileNotFoundException fnf){
System.out.println("Problem!!!");
}
====================================
Suppose the link provided should be "File Not Found".
The problem is why I can't check this out by
getResponseCode()? I have used getResponseCode() to check for file that existed, it performed well.
-How can I check for "File Not Found"?
-How can I check for redirection of a page?
Thanks for your help!!!
I would like to create a directory, and store newly created files in it.
How can I do that?
I only know how to create a file
Thank you for your help!
22 years ago
I have created a menu. Whenever a menu item is selected, the previous displayed components will be set invisible, and the new components will be set visible.
Suppose I have a menu button called, "Add". It has two menu items---"A Book" and "A CD".
First I selected "A Book", then selected "A CD". Those displays are good. However, when I selected "A Book" again, its components display is in a mess. Why?
The following is part of my code:
=================================
.......
addBook.addActionListener(new AddBookListener(this, c));
addCD.addActionListener(new AddCDListener(this, c));
.......
class AddBookListener implements ActionListener
{
private Exer3 myApplet=null;
private Container myContainer = null;
//Constructor
public AddBookListener(Exer3 app, Container c){
myApplet = app;
myContainer = c;
}
//Define actionPerformed()
public void actionPerformed(ActionEvent e){
//Clear the pane by calling a helper method--invisibleAll()
helperClass help= new helperClass(myApplet);
/*=====Set Invisible======*/
help.setInvisibleForAddCD();
/*=====Set visible========*/
help.setVisibleForAddBook();
//Design the layout of the pane
designLayout();
//Ensures that the Container has a valid layout
myApplet.validate();
....
....
(AddCDListener did the same thing)
}//End of actionPerformed()
.....
.....
class helperClass{
Exer3 myApplet= null;
public helperClass(Exer3 app)
{
myApplet = app;
}
/*===========Set Visible====================*/
public void setVisibleForAddBook()
{
myApplet.lblHead1.setVisible(true);
myApplet.lblCata1.setVisible(true);
......
......
public void setVisibleForAddCD()
{
myApplet.lblHead2.setVisible(true);
myApplet.lblCata2.setVisible(true);
......
......
public void setInvisibleForAddBook()
{
myApplet.lblHead1.setVisible(false);
myApplet.lblCata1.setVisible(false);
......
......
public void setInvisibleForAddCD()
{
myApplet.lblHead2.setVisible(false);
myApplet.lblCata2.setVisible(false);
.....
......
Please help me to solve the problem.
Thank you for your help!
22 years ago
Suppose I have a panel and 2 buttons on it. If buttonA is pressed, a textfield component will be displayed. Similarily, when another button, buttonB is pressed, a textfield and a list components will be displayed.
I would like to know how can I destroy those previous appeared components and let other components display on the panel?
Can I display different panels depends on which button is pressed? But the problem is how can I destroy the previous appeared panel?
Thank you for your help!!!

22 years ago
Sorry!! I mean I "can't" dynamically display those components on the panels when specified item is selected in the list object
22 years ago
I've created a TabbedPane and put 3 panels on it.
One panel, say subpanel1_A, contains a JList object which shows 2 items--"Label_1", "Label_2". When "Label_1" is selected, a label object will be shown on subpanel1_B. Similarily, when "Label_2" is selected, another label object will be shown on subpanel1_C. The problem is I can dynamically display those objects when a specified item in the List is selected.
Followwing is part of my code:
================================
public class Skill_1 extends JApplet{
//Define a JTabbedPane object
JTabbedPane tabbedPane=null;
//Define JPanel objects
JPanel panel1=null;
JPanel subpanel1_A = null;
JPanel subpanel1_B = null;
JPanel subpanel1_C = null;
//on subpanel1_B
JLabel lblB = null;
//on subpanel1_C
JLabel lblC = null;
JList listPanel1=null;
........
........
String[] actions={"Label_1", "Label_2"};
listPanel1 = new JList(actions);
subpanel1_A.add(listPanel1);
..........
listPanel1.addListSelectionListener(new test (this, lblB, lblC));
..........
..........

class test implements ListSelectionListener{
private Skill_1 myApplet;
JLabel lbl1 = null;
JLabel lbl2 = null;
public test(Skill_1 sk1, JLabel lblB, JLabel lblC)
{myApplet=sk1;
lbl1=lblB;
lbl2=lblC;
}
public void valueChanged(ListSelectionEvent e){
int s = myApplet.listPanel1.getSelectedIndex();
System.out.println("********s = " + s);
if(s==0){
System.out.println("panelB");
myApplet.subpanel1_B.add(lbl1);
}
else if (s==1){
System.out.println("panelB");
myApplet.subpanel1_C.add(lbl2);
}
}
}//End of valueChanged
}//End of test
Thank you for your help!!!
22 years ago
I would like to extract the specified field again after displaying all the fields in a record.
The code is as follows:
============================
.......
while(rs.next()){
ps.println("<tr>");
for (int i=1; i<=nCols; i++) {
ps.println( "<td width=20%>" + rs.getString( i ) + "</td>");
}
}
//Extract the field again
String p = rs.getString(2);<---Why I can't get the value again???

double subtotal = q * (Double.valueOf(p).doubleValue());

ps.println("<td width=20%><font color = red>$" + subtotal + "</font></td>");
.......
.......
Thank you for your help!!
I can't get the value of parameter, it returns null!!!
The following are the codes of the 2 servlets:
============================
For servlet A:--Display a textfield and an image
.....
.....
out.println("<input type=\"text\" name=\"qty\" value=1 size=2>");
out.println("<a href = \"http://localhost:8080/slt/Add_Products?prdID=" + rs.getString(1) + "\">" + "<img src = \"http://localhost:8080/slt/myimages/add.gif\" border=0></a>");
......
.....
**********************
For Servlet B----Get the value of "qty"
=======================================
public void init(ServletConfig config) throws ServletException{
super.init(config);
ss=(String) config.getServletContext().getAttribute("qty");
System.out.println("******ss = " + ss);
........
........
22 years ago
Suppose I have 2 servlets, say, A and B
Servlet A displays a textfield and an image.If the user entered his name in the field and pressed the image, servlet B will be called. I would like to know how the value in the textfield can be passed to servlet B for performing another action.
22 years ago