Rajendar

Greenhorn
+ Follow
since Feb 28, 2002
Merit badge: grant badges
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 Rajendar

yes,u can set the components border to null or
create a Empty border as follows...
paneScrollPane.setBorder(BorderFactory.createEmptyBorder());
20 years ago
hi ,
i tried the Border thing and it worked fine.
also i am not clear with ur question..can u show the code....
mean while,i wrote this Border example.Try this out..
import java.awt.*;
import java.awt.event.*;
import javax.swing .*;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
public class border extends JFrame
{
JPanel compoundpanel,titledpanel;
Container cont;
Border compound,titled,raisedbevel,loweredbevel ;
JTabbedPane pane;
border()
{
cont=getContentPane();
pane=new JTabbedPane();
compoundpanel=new JPanel();
raisedbevel = BorderFactory.createRaisedBevelBorder();
loweredbevel = BorderFactory.createLoweredBevelBorder();
compoundpanel.setBorder(BorderFactory.createCompoundBorder(raisedbevel,loweredbevel));
titledpanel=new JPanel();
titledpanel.setBorder(BorderFactory.createTitledBorder("title"));

pane.addTab("titled",titledpanel);
pane.addTab("compound",compoundpanel);
cont.add(pane,BorderLayout.CENTER);
}

public static void main(String a[])
{
JFrame frame =new border();
frame.setSize(400,400);
frame.setVisible(true);
}
}
20 years ago
Hi i tried ur code and was able to compile with out errors.. try to check it out.
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.*;

/**
* Title:
* Description:
* Copyright: Copyright (c) 2002
* Company:
* @author
* @version 1.0
*/
public class Selection extends JFrame implements ActionListener {
int to;
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel1 = new JPanel();
JScrollPane jScrollPane1 = new JScrollPane();
JTable jTable1;
Object[][] data1 = {
{"440", "GMC-3000", "300", "GTH-600", "400-600", "GMC-150", "GMC-300", "ABS803a", "800", "200"},
{"220", "GMC-150", "150", "GTH-220", "160-240", "GMC-100", "GMC-150", "ABS403a", "400", "100"},
{"165", "GMC-150", "140", "GTH-220", "120-180", "GMC-85", "GMC-150", "ABS403a", "300", "100"},
{"528", "GMC-400", "400", "GTH-600", "400-600", "GMC-220", "GMC-400", "ABS1003a", "1000", "325"},
{"264", "GMC-180", "180", "GTH-400", "200-300", "GMC-100", "GMC-180", "ABS603a", "500", "150"},
{"198", "GMC-150", "140", "GTH-220", "160-240", "GMC-100", "GMC-150", "ABS403a", "350", "100"},
};
Object[][] data2 = {
{"440", "GMC-600", "600", "GTH-600", "400-600", "", "", "ABS803a", "800", "250"},
{"200", "GMC-220", "220", "GTH-220", "160-240", "", "", "ABS403a", "400", "150"},
{"176", "GMC-180", "180", "GTH-220", "160-240", "", "", "ABS403a", "350", "150"},
{"528", "GMS-600", "600", "GTH-600", "400-600", "", "", "ABS1003", "1000", "325"},
{"264", "GMS-300", "300", "GTH-400", "200-300", "", "", "ABS603a", "500", "200"},
{"211", "GMS-300", "250", "GTH-400", "200-300", "", "", "ABS403a", "400", "200"},
};
String[] columnNames = {"Name",
"Power",
"watts",
"Qty",
"TOR",
"Rate",
"운전용접촉기",
"Code",
"�",
"$"};
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
String[] start = { "Y-Delta 기동", "직입기동"};
String[] voltage = { "200V~240V 3상 60 Hz", "380V~440V 3상 60 Hz","500V~550V 3상 60 Hz"};
String[] mt = { "110kW, 150HP", "132kW, 180HP"};
JComboBox jComboBox1 = new JComboBox(mt);
JComboBox jComboBox2 = new JComboBox(start);
JComboBox jComboBox3 = new JComboBox(voltage);
/**Construct the frame*/
public Selection() {
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(borderLayout1);
this.setSize(new Dimension(800, 500));
this.setTitle("Power Example");
jLabel1.setText("Name");
jLabel2.setText("Frequency");
jLabel3.setText("Watts");
jPanel1.add(jLabel1, null);
jPanel1.add(jComboBox2, null);
jPanel1.add(jLabel2, null);
jPanel1.add(jComboBox3, null);
jPanel1.add(jLabel3, null);
jPanel1.add(jComboBox1, null);
jPanel1.add(jScrollPane1, null);

contentPane.add(jPanel1, BorderLayout.NORTH);
jComboBox1.setSelectedIndex(0);
jComboBox2.setSelectedIndex(0);
jComboBox3.setSelectedIndex(0);
jComboBox1.addActionListener(this);
jComboBox2.addActionListener(this);
jComboBox3.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if(jComboBox2.getSelectedIndex() == 0){
to = 3* (jComboBox3.getSelectedIndex()) + jComboBox1.getSelectedIndex();
jTable1 = new JTable(data1, columnNames);
}
if(jComboBox2.getSelectedIndex() == 1){
to = 3* (jComboBox3.getSelectedIndex()) + jComboBox1.getSelectedIndex();
jTable1 = new JTable(data2, columnNames);
}
jScrollPane1.getViewport().add(jTable1, null);
jTable1.setPreferredScrollableViewportSize(new Dimension(790, 300));

}

/**Main method*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
Selection frame = new Selection();
frame.setVisible(true);
}
catch(Exception e) {
e.printStackTrace();
}
}

}
20 years ago
Hi,
I tried this example and was able to get it working in Netscape6.but it failed in IE5.5.
i think theres some thing to do with security settings related to applets.Also i got it to working ,after removing code related to that paint.
20 years ago
There may be leading spaces after 'reg'.first try to trim it in the database and then try retrieving tehm.it may return rows..
mark,
yes swing is very powerful when compared to awt.
it got a lot more useful classes which makes life easy.
The eventhandling mechanism is the same as in Awt ,but u can achieve a lot than that in Awt.
classes like JTable,JTree which help u create tables and trees directly,which wasnt possible in AWT.
Like this there are a lot more useful classes.Learning swing is not difficult.
Hope this helps..

Originally posted by mark stone:
i am starting out with swing. (awt was simple and fun to learn and easy too...)
there is a prefix 'J' for similar classes in awt. (looks though from the api heirarchy)
like Component (in awt) and JComponent (in swing) but then there is nothing as JContainer ?
can someone let me know some sort of similarities etc between swing and awt so that learning can be easy and logical too ?
(one difference was with how we add components in awt and swing, any other differences... )
and the class JColorChooser, wow what a class.... its a full fledged application ! any other such noteworthy classes !!!
20 years ago
Originally posted by mark stone:
i am starting out with swing. (awt was simple and fun to learn and easy too...)
there is a prefix 'J' for similar classes in awt. (looks though from the api heirarchy)
like Component (in awt) and JComponent (in swing) but then there is nothing as JContainer ?
can someone let me know some sort of similarities etc between swing and awt so that learning can be easy and logical too ?
(one difference was with how we add components in awt and swing, any other differences... )
and the class JColorChooser, wow what a class.... its a full fledged application ! any other such noteworthy classes !!!
20 years ago
Hi,
I wrote a java bean and tried to call it from a jsp page.i placed the class and file in
tomcat\webapps\examples\WEB_INF\classes\
when i submit the jsp page, it displays an internal server error.
org.apache.jasper.jasperException:unable to compile the class for JSP
waiting for response.....
20 years ago
JSP
once u wrote servlet and placed in servlets directory,u need to access it by http://127.0.0.1:8080/servlet/test and not by
http://127.0.0.1:8080/servlets/test.it is because servlets is a directory and each is a independent servlet in that directory.so
access by servlet and not by servlets in its URL

Originally posted by chandarv:
I have downloaded the trial version of javawebserver2.0. I coded a small servlet test in c:\javawebserver2.0\servlets directory and compiled it and put the class file in the same directory. After starting the server i tried to run the servlet by
http://127.0.0.1:8080/servlets/test
and i was getting a status coded of 404 Requested URL not found.
Can any one help me in this regard.
Also can any one tell me how to code servlets (Which directory) in javawebserver2.0 and where the class file has to be.
Thanks a bunch
Chandar


22 years ago