66 Discussion / Question Topics

Remove Filter
Member Avatar for Dean_Grobler

Hi there, This is just going to be a quick question. Also just note that I am i some "remote location" so I cant even show you my code. But what I want to know is this: Say you have a package called "myPackage" and inside that you have 2 …

Member Avatar for JamesCherrill
0
143
Member Avatar for Dean_Grobler

Hi there, I'm getting an error saying: non-static variable MainList cannot be referenced from a static context. My snippet of code where the error is occuring: [CODE] //this method is in a class called ViewContact public void printInfo(){ int index = MainScreen.MainList.getSelectedIndex(); } [/CODE] Now the List "MainList" is in …

Member Avatar for JamesCherrill
0
128
Member Avatar for Dean_Grobler

Hi there, In my little code snipet below I am trying to convert an arraylist to an array of type contact. Obviously it's expecting an arraylist of type contact to convert it to an array of type contact. But it's picking up the arraylist as type object for some reason. …

Member Avatar for Dean_Grobler
0
140
Member Avatar for Dean_Grobler

Hi there, A thread was started earlier about splitting up a String using the split() method of the string class. Reading that did help me quite a lot in solving a problem of mine that is VERY similiar. Say I have this in a txt file: "Dean Grobler 0794400541 NA …

Member Avatar for Dean_Grobler
0
179
Member Avatar for Dean_Grobler

Hello there, In one of my projects I'm working on currently. I have a 'cancel' button in my GUI window that is suppose to close the JFrame the button resides in. I have done some research on the web about this. But it seems like one has to write a …

Member Avatar for masijade
0
132
Member Avatar for Dean_Grobler

Helooo, Attached is a pic of my main screen of my program. Basicly it's a phone book app similiar to one you'd have on your phone. The thing that I can't wrap my mind around, is that you see the nice big textArea there? After you've added a contact now. …

Member Avatar for masijade
0
175
Member Avatar for Dean_Grobler

Hi there, Consider the following code, this is a little 'snipet' from one of my classes: [CODE] private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) { NewContact n = new NewContact(); } [/CODE] The method is expected to open a new Frame, where the class of the new Frame is called "NewContact". I've recently …

Member Avatar for JamesCherrill
0
374
Member Avatar for Dean_Grobler

Hi there, I just wanted to find out if one can have a actionListener() in one .class file and then have the actionEvent() in another .class file? If not, how would I go about to get the same effect? Thanks!

Member Avatar for Dean_Grobler
0
450
Member Avatar for Dean_Grobler

Hello! Attached is a file (GUI.png), I quickly did this in excel so.. It looks pretty crappy obviously. But when you take a look at the image and the layout of the components etc. What would you say is the best LayoutManager to use with this? GUI design is fun, …

Member Avatar for Adil Ahmed Zeb
0
135
Member Avatar for Dean_Grobler

Hi there, In the code below my ImageIcon isn't showing when I run the program. I always struggle with adding Images in my GUIs and it's irritating. Is there some all important rule that I should know or something? [CODE] //Create window Components JLabel lblrequest = new JLabel("Enter amount of …

Member Avatar for JamesCherrill
0
4K
Member Avatar for Dean_Grobler

Hi there, I've just switched to Eclipse. I've been using TextPad so Eclipse is pretty cool.. But I've been getting weird error messages that I don't understand/not used to. Here they are: [CODE]JButton btnEnter = new JButton("Enter"); btnEnter.addActionListener(this);[/CODE] Here the Error says: Multiple markers at this line. -Syntax on token …

Member Avatar for Dean_Grobler
0
200
Member Avatar for Dean_Grobler

Hi guys, I have this assignment to do: Synchronize access to the instance variable, accBalance. Because accBalance is a double and not an object, it cannot be used as the monitor. Use synchronized methods or synchronized blocks of code, as appropriate. Simultaniously test two threads. Because the threads can complete …

Member Avatar for Dean_Grobler
0
149
Member Avatar for Dean_Grobler

Hi there guys, I got this assignment where I need to set a session attribute. Although I'm having problems since I cant set attribute that is of type double? I got these hints but since I've worked with doubleValue() or downcasting, the hints didn't help me much.. Hints: -Recall that …

Member Avatar for Dean_Grobler
0
239
Member Avatar for Dean_Grobler

I'm struggling with a servlet that's suppose to represent an "online banking service". Once you run the servlet you'll see it's an extremely simple example... You enter an amount in the textfield provided, then click on the apropriate button depeding what action you want to perform e.g. "deposit","withdraw" and "balance". …

Member Avatar for martin5211
0
98
Member Avatar for Dean_Grobler

Hi all, Does anybody know what this "WSaction" is? What it does and most importantly how it works? I've tried googling this but hardly found ANYTHING.. I'm busy working with Servlets and as far as I can tell it checks what button was pressed in the HTML form.. But I'm …

Member Avatar for Dean_Grobler
0
104
Member Avatar for Dean_Grobler

Hi there, Name's Dean, I'm a java student here in sunny South Africa.. Very impressed by daniweb! Been with other IT communities, and daniweb seems way more ontop of things. Other than that, I'm excited on helping other java students like myself. And I still have tons of questions that …

0
27

The End.