Please help me fix the problem. -
Hi.
I use the constructor to get the information from the database, but it doesn't complie. Here is my code for the constructor.
=============================================
public getData() {
Connection c = DriverManager.getConnection_("jdbc

dbc:GradeData");
ResultSet r = c.createStatement().executeQuery("SELECT_ ProductID, ProductName FROM Inventory");
ResultSetMetaData rsmd = r.getMetaData();
int i = 0;
while (r.next()) {
strItemNo_Descript[i] = r.getInt("ProductID") +"\t"+ _r.getString("ProductName");
++i;
}
c.close();
//Set all the elements of JFrame
JPanel content = new JPanel();
labelInstruct = new JLabel("Please select the item no");
content.add(labelInstruct);
itemList = new JList(strItemNo_Descript);
itemList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
itemList.setVisibleRowCount(8);
// ======== Here is the problem.===========
itemList.addListSelectionListener(this);
itemPane = new JScrollPane(itemList);
content.add(itemPane);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
} );
}
==============================================
The code above has the following error:
addListSelectionListener(javax.swing.event.ListSelectionListener)_ in javax.swing.JList cannot be applied to (getData)_itemList.addListSelectionListener(this);
Would you tell me how to fix this?
Thank You Very Much.
Jacob
SQL - The value violates the MaxLength.... (new problem) -
Aight.. i'm just editing this post...
I figured out my earlier problem, but now i'm facing a new problem.. I've set the column to varchar(MAX) but still it won't work even when the FriendlyName is under 100 chars.. i also tried to set it to 1000, but same problem...
problem There seems to have been a slight problem with the database -
hello,
my board is not working
and appeared this message :
---
There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.
An E-Mail has been dispatched to our Technical Staff, who you can also contact if the p
Problem with C++ dll calling by VB GUI -
Hi Guys,
I am having a problem with dll. I want to build one from C++ to VB. I have same problem as LucianJay. No answer yet in Forum. Did Lucian Jay solve problem? When I run my form I get same error: Trying to access protected memory. I am new programmer can submit my code if
Trimming Problem -
When you do the following It will not trim advice would be appricated
DIM PROBLEM AS STRING * 50
PROBLEM = "PROD"
PROBLEM = RTrim(Mid(PROBLEM , 1, InStr(1, PROBLEM , " ") - 1))
FOR SOME REASON IT DOES NOT SEE THE SPACES BEHIND PROD. IF I ADD A CHAR TO T
problem in Session End - vijay -
Hi!
I have a problem in our login page.Actually we won't allow more than a time ,same user to log on.
Problem goes here ......If the User log out properly thru the LogOut Link ,there will not be any Problem.If the User not properly Log out either by closing the browser/ Diconne
Problem with API -
Hai guys,
I have downloaded a program for ftpclient. and i have started to learn the code by tracing. there i had a problem, if i end the prgm in the middle, then the entier vb is closed. i dont know why this is happening. can any one explain whats the problem and where is the
Ram Problem -
Hi ... before 10 days (in a rainy day) .. i m seeing moive on my PC
Suddenly i saw a lot of blue lines ... on my desktop..
I directly close my PC thru shutdown button on my pc...
after a day when i open My pc it give a BEEP...
No screen appear.. some peoples told that it
SP2 and VB6 app problem -
I'm having a rather odd problem with an app of mine - people who are running SP2 are noticing a point while running the app that the app just seems to freeze up for a long time before continuing while anyone else who is running anything but SP2 does not have this problem.
I realize
Compiler GUI problem due to game -
The problem is -- whenever I run the Run the game in fullscreen all goes fine...But whenever I exit and restore everything the compiler GUI becomes the size of the resolution I used so in my case it goes from 1024x720 to 800x600.
When I used to make games in VB6 I had this problem A
Can someone help with these SQL queries (URGENT) -
I am having trouble with this so must hand it over to you, the experts...
Need some SQL queries that can possibly pull some info from across 3 tables...
My tables are like as follows:
QUERY
QueryID, QueryDetails, QueryStatus, UserID, AdminID, CustomerID, TaskID
TASK
Horizontal Scrolling Text Box -
Hey all, i would likee to introduce you too, Mr Problem.
Mr Problem: Hello All
Ok, Mr problem is a problem, what i want to do is make a text box scroll back and forth because the text is too long, any suggestions?
help.........<urgent> -
hi, anyone out there, i have a big problem. when ever i have load my project, then after that when i restart computer it will prompt that that is a registry problem and need to restart and store with a old one....why was this happen, this problem keep on happening even i just load the
Help me on VB 6.0 - Crystal Report -
I'm not very good in English. I hope you understand my problem...
Firstly, I don't know why I have a problem when I used subreport. I'm using Sybase as my database in NT environment but in later I have to execute my VB and my report in UNIX. Is that any problem? Actually, I have
Textbox Tab Problem -PLS HELP -
Hello.
Have a weird problem. Win NT Office 2000, Excel VBA running a spreadsheet
that when strarted automatically show's a userform for data input.
The problem I have is that on some machine's on the network... when the user
uses the tab key to advance to the next textbox it places
the ' char problem again.... -
Hello Everybody,
how can i prevent this problem:
the user entered name or something with the ' char
yes i know that rathi had the same problem but if there are
more then one word, how can i change the string to avoid
the problem of incorrect sign near.... when ' is inside the stri
Richtext problem within win98 -
I have got a problem. I have made a chat program and I use a
Richtext control. Now when I use win2k or winxp it just works fine. But when I use win98 ( haven't tested it on other platforms yet) I have a problem. The richtextbox puts all info directly behind each other. How to fix th
A silly problem... -
I have slite problem. I have made the Project Explorer window not dockable. And now I have the problem to get it to dock to the right side. To the top and to get the property window dock under it is no problem. I want it to look as when you install it. How?
It's probably been posted before... -
Computer Problem Report Form
1. Describe your problem: _
2. Now, describe the problem accurately: _
3. Speculate wildly about the cause of the problem: _
4. Problem Severity:
a. Minor _
b. Minor _
c. Minor _
d. Trivial _
5. Nature of the problem:
a. Locked
autofilter problem again -
Hi everyone again,
sorry for disturbing same problem again.I have had good help from you about my problem before;but still i can not solve my problem totally.
When i write first letter in txtFilter i could show related(filtered) records on MSFlexGrid.(autofilter in MSFlexGrid)
i
LAN problem -
I have been trying to make a LAN with the two computers in my house but I have a problem... Both adapters are sending data but neither of them are recieving anything! Could the problem be with the cable?
Thanks
new problem -
First of all I want to thank everybody for their help on previous problem..
My next problem is
what would be the best way of writing a small progam for this.
2+6 = ?
the person needs to put in the correct answer if they don't it needs to tell them that it's wrong
Integration Problem ! -
Hi Guys,
Can anybody give me a hand answering this little problem?
It's a pretty straight forward (for somebody who is good with integration - unfortunately i'm not).
I have uploaded a screenshot of my problem to the following webpage:
Integration Problem - Click here
An
Problem with my DLL at runtime... -
Hi all,
I'am having some problems with one of my DLL ( I think ).
The problem is that when I leave the app that calls for functions in the DLL I almost always crash my computer !!!
The problem doesn't seem to appear when I run my app from the EXE but only when I run it in VB ??
Problem with mshtml.dll/Active Desktop Html. Pls Help -
Hi there... I have got two(2) problem. Pls help me.
------------Problem One---------------------------
I am having a problem with my computer Win98. The problem is that I am getting an error message all the time i.e. "The Active Desption Html cannot be found. Click Ok to turn
Problem with ASP & IIS -
I'm installed IIS 5 (win2000) but now I have problem with ASP.
IIS is running but when start any ASP page it don't work?????
How fix this problem?
DbCombo search problem -
Ok here's my problem, I have a group of 20 Dbcombo boxes inside a frame on two different forms. Every combo box is a controlled array and has the same properties (except the tab index and top).
The problem is when you click on the dropdown button and start to type what you are look
logout problem -
Dear All,
I have developed an web application. I am running it with IE 6.0.
But now I am facing a problem. when someone logout from the system then he must have to have login again. But the problem is that if someone logout and then click the BACK button on IE 6.0 the previous pa
Can anyone tell me what is the problem -
Hi everyone,
I currently had a problem. It sound like this. When i install the Microsoft Visual Studio stuff into my computer and surprisingly all the *.dll files cannot register in my system registry.
What is the problem ???????
SQL Data Reader Problem -
Hey everyone
I am having a problem closing a SqlDataReader before opening the next one in line.
The problem is I can't close the first one because the second needs the info.
Is there anyway to leave both open at the same time, and if not can anyone help?
Thanks to anyone w
Strange and B.I.G Problem -
HI friends !!! , i have a strange and big problem in VB6 which i can't solve !!!
i've developed a 9MB software which startup automaticaly when turning on the PC , but the problem is that some functions (SOMETIMES) are not working !!! .
The problem :-
When the program runs ... it
OLE Automation error -
I've just come across an interesting problem in one of my applications when using a data control and an Apex TDBGrid. After setting the type, recordsource and executing the refresh method, I am getting the OLE Automation error '-2147417848: Object invoked has disconnected from it's cl
How To Know That 11.00 Differes Than 9.30 By One Hour And A Half -
Hallo, i have stored times of lectures in DB as char, now i want to know if there is a number of following subjects like 8.00-9.30,9.30-11.00,11.00-12.30 the problem is that if i subtracted 9.30 From 11.00 it will give 1.70 not 1.30 , so is there a problem or function to solve this pro
Ms sql server problem -
Hi,
I have question regarding sql server database connection problem. I've a project using Visual Studio.Net 2003 ASP.Net Web Application.
The problem is why I can compile my project sometimes but sometime it show error while I on my computer next time? What is the thing I must c
[02/03] Date Problem on my Application -
Good Afternoon All
I have a VB.NET App, the App is ok, we sell it to Clients and never had a Problem. One Client Called and tell me about the Problem or Exception on the Application and when he send me a Screenshot i was shocked . What is Wrong , please look at a Screenshot. This
MsComm Problem (Buffer Size) -
Hey Guys,
I had a search through the forum and cant find the solution to my problem.
I am sending a long string using the MsComm control.
We aren't using a connection... no handshaking is involved. It is assumed that the destination is receiving the data.
Now, the problem i
Please Help:Autofilter problem again and again -
Hi everyone again,
sorry for disturbing same problem again and again.but still i can not solve my problem totally for two weeks.I have had good support from you before but still i can not solve the problem.
When i write first letter in txtFilter i could show related(filtered) rec
ADO Access Problem -
Hi All,
I have a problem with my ADO Access. I have developed an application which is worked without any problems but when I try to install it in a nother Computers which do not have VB, the application run but no data from SQL Server Access can be see or edit. I try to change the ref
Winsock Problem--> plss Help -
hello,
I am attaching a client-server application,
first run the server , the run the client
a connection established between client-server
a client can send a file to server.
The main problem is that the received file contains
redundancies most of the times.
How ca
SmartMenuXP Problem (Popup Menu) -
I have a problem with SmartMenuXP, I was trying to use it as a popupmenu in a treeview, my problem is that when i click the item in the popup, it does not trigger the click event. Did you encounter this problem? How did you solve it?
Access Report Format Problem -
The title of my reports are always getting scrunched together to the point where letters overlap, how do I get them to spread back out? Below is a screenshot of the problem:
Can anyone help?