Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
~2K People Reached
Favorite Forums
Favorite Tags
java x 25
Member Avatar for harsimran05

when i am trying to use delete button on my frame it is showing such exception and stack trace is here java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer at MyFrame.actionPerformed(AcctHld.java:225) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:253) at java.awt.Component.processMouseEvent(Component.java:6099) at javax.swing.JComponent.processMouseEvent(JComponent.java:3287) at java.awt.Component.processEvent(Component.java:5864) at java.awt.Container.processEvent(Container.java:2109) at java.awt.Component.dispatchEventImpl(Component.java:4460) …

Member Avatar for harsimran05
0
342
Member Avatar for harsimran05

i have a program that has a database in access and i want to update data but when i click on update button on my frame nothing happens no error no exception and no work. here is my code [CODE]bUpdate=new JButton("Update"); bUpdate.setBounds(275,600,100,50); c.add(bUpdate); bUpdate.addActionListener(this); public void actionPerformed(ActionEvent ae){ Object o=ae.getSource(); …

Member Avatar for peter_budo
0
102
Member Avatar for harsimran05

when i use border layout and centre alignment, my label content is appearing on left side but i need it on right side, suggest any change here is my code [CODE]import java.awt.*; import javax.swing.*; import java.awt.BorderLayout; class Welcum extends JFrame { Container c; JButton bFd,bAcct; JLabel lWelcome; public Welcome() { …

Member Avatar for harsimran05
0
93
Member Avatar for harsimran05

i have a a file Fd.java in which i am trying to call constructor of another class TRrelatn and both the classes are kept in same folder but it is giving error as well as exception that is :\Fd.java:368: cannot find symbol symbol : class TRrelatn location: class FrmAdd new …

Member Avatar for Zaad
0
180
Member Avatar for harsimran05

i am trying to create a project file from existing main files , i create my project file(FixedDeposit) where other files are kept i want to add, and i use the option add existing file and add all the files i want to add. And i make the main of …

Member Avatar for harsimran05
0
80
Member Avatar for harsimran05

i have taken two fields date of issue and date of maturity like this [CODE]try { tDateofIssue=new JFormattedTextField(new MaskFormatter("##-##-####")); tDateofIssue.setBounds(200,130,125,30); c.add(tDateofIssue); } catch (Exception ex) { ex.printStackTrace(); } try { tDateofMaturity=new JFormattedTextField(new MaskFormatter("##-##-####")); tDateofMaturity.setBounds(200,400,125,30); c.add(tDateofMaturity); tDateofMaturity.addFocusListener(this); } catch (Exception ex) { ex.printStackTrace(); }[/CODE] and taken both the field of date/time …

Member Avatar for JeoSaurus
0
95
Member Avatar for harsimran05

i want to add isEnabled() method to JTextField, i write a code [CODE]tRate=new JTextField(); if (tRate.isEnabled()){ JOptionPane.showMessageDialog(c,"press any key to get rate"); }[/CODE] but it is giving message just after compilation of program instead when tRate is enabled

Member Avatar for harsimran05
0
150
Member Avatar for harsimran05

can we add mouse click event on multiple controls in a single frame, if yes plzz specify the code or jst giv starting of code

Member Avatar for Majestics
0
64
Member Avatar for harsimran05

i hav created a combobox and add elements to it from database . combobox contain elements lyk 1-2year,12 months,5-9years, means numeric as well as text. but now i want to extract only numeric data from it as 1-2 year or12 months. so plz suggest any code tht can retreive only …

Member Avatar for JamesCherrill
0
73
Member Avatar for harsimran05

im tr table only 2 column exist , first1 time period of text type nd 2nd is rate ,i.e also text type,my code is [code] try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:DRIVER=Microsoft Access DRIVER (*.mdb);DBQ=trrelation.mdb"); String tp=(String)mTimePd.getElementAt(cTimePd.getSelectedIndex()); PreparedStatement ps=con.prepareStatement("select Rate from tr where TimePeriod=?"); ResultSet rs=ps.executeQuery(); ps.setString(1,tp); while(rs.next()){ tRate.setText(rs.getString(2)); } con.close(); } …

Member Avatar for JamesCherrill
0
79
Member Avatar for harsimran05

[CODE]import java.awt.*; import javax.swing.*; import java.sql.*; import javax.swing.text.MaskFormatter; import javax.swing.table.DefaultTableModel; import java.util.Vector; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; class MyFrame extends JFrame implements ActionListener,MouseListener{ Container c; JLabel lAccountNo,lAName,lDateofOpng,lAddress,lContactNo,lTotalBalance; JTextField tAName,tContactNo,tTotalBalance; JTextArea tAddress; JFormattedTextField tDateofOpng,tAccountNo; JButton bAdd,bNew,bDelete,bExit,bUpdate; DefaultTableModel mAccthld; JTable tAcctHld; MyFrame(){ c=getContentPane(); setSize(Toolkit.getDefaultToolkit().getScreenSize()); setTitle("Account Holder"); setLayout(null); lAccountNo=new JLabel("AccountNo."); …

Member Avatar for JamesCherrill
0
157
Member Avatar for harsimran05

import java.awt.*; import javax.swing.*; import javax.swing.table.DefaultTableModel; import java.util.Vector; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.text.MaskFormatter; import java.sql.*; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; class MyFrame extends JFrame implements ActionListener,MouseListener{ Container c; JLabel lRollNo,lName,lAge,lMarks; JTextField tRollNo,tSName,tMarks; JTextField tAge; DefaultTableModel mStud; JTable tStud; JButton bAdd,bNew,bRemove; MyFrame(){ c=getContentPane(); setLayout(null); setTitle("My Frame"); setSize(800,700); setLocation(10,10); lRollNo=new JLabel("Roll no"); …

Member Avatar for peter_budo
0
156
Member Avatar for harsimran05

showing illegal start of expression in defining functions of mouselistener interface import java.awt.*; import javax.swing.*; import javax.swing.table.DefaultTableModel; import java.util.Vector; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.text.MaskFormatter; import java.sql.*; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; class MyFrame extends JFrame implements ActionListener,MouseListener{ Container c; JLabel lRollNo,lName,lAge,lMarks; JTextField tRollNo,tSName,tMarks; JTextField tAge; DefaultTableModel mStud; JTable tStud; JButton …

Member Avatar for JamesCherrill
0
415