Extracting Characters
If I were making a program that had a user-inputted string, and then I wanted to extract the first, middle, and last letter of that string and print them out, how could I do that? I know how to get the...
View ArticleMoving Ellipse2D using keyboard events
Hello, I am trying to simply move a ball that I have drawn using keyboardEvents. I know this is very simple, but I cant seem to make it work. What am I missing? public class Baller extends JPanel { int...
View ArticleClick Image for shop in game instead of button?
Is there anyway that I can click an image and put an actionlisterner for it? or it is just for button and stuff.
View Articlequestion
Hello,this is my 1st post in this blog.I need some idea about current project topics that are being used vastly now a days. Would you please give me suggestions about what should be my project topic or...
View ArticlePolymorphism with arrays issues.
I am having an issue with my program and I do not understand how to create an application that has an array of some size, say 5. And the array should be defined of the superclass type. Then create 5...
View ArticleMapReduce/MRjob
How would I go about getting something like this: "act according" 1 "act accordingly" 1 "act against" 1 "act as" 1 "act but" 1 "act if" 1 "act in" 1 "act of" 7 "act on" 2 "act with" 1 "act without" 1...
View Articlehow can I hide the JButton?
I was trying to hide my JButton and set it to setVisible(false) but when I set to setVisible(true) it doesnt show. is there any way of hiding and showing button?
View ArticleArray output
I am trying to get the output to display the element from each array. Program will find and display the highest empNo but I have tried all different ways in the "return" from getMax() in the derived...
View ArticleZooming an image centered on mouse coordinates
Hello, I've been trying to solve this for a couple of days now but i just don't get it.. I have a UserControl which acts like an advanced version of the PictureBox. Changing image / panning the image...
View ArticleGetter and Setter Functions for a class within a class
I'm not sure if I am being incredibly stupid but what are your opinions on how I should set values in a class by using getter and setter functions. Should I either do : Class A { private: int a; int b;...
View ArticleScanner input in Eclipse
Just something I'm curious about, in Eclipse when I use: Scanner input = new Scanner(System.in); System.out.println("Enter a degree in Celsius: "); double celsius = input.nextDouble(); Why does eclipse...
View Articleswing application to applet problem
Hi i have multiple classes in my swing application and i have each class opening its own frame. How do i create an applet for this application? Please help
View ArticleBinary to Decimal task
Hi :)this is my codes, we are suppose to convert binary to decimal without using array, and use a data file as input and keep tack of valid input's answers. #include <fstream> #include...
View ArticleHelp with this problem with functions/classes/structures
#ifndef STORE_H #define STORE_H #include <iostream> #include <iomanip> using namespace std; class Store { public: Store( ); Store (int, char[], int, double, double, int, double); int...
View Articlerestart applet
Hello I would like to restart my applet ( clear all current variables and everything)and start again as if I just opened the applet. From what I read on the internet I tried to call stop(), destroy()...
View ArticleCustom ProgressBar Question
I am trying to use a panel and a picturebox as a progress bar. The panel displays the background image and the picturebox displays the fill bar. On the form I also have a progress bar with a max value...
View ArticleQuestion About Checking Values of Arrays
So for the project I am working on I have an array that randomly generates 25 integers between the values of -10 and 15. I have a value stored to each element of the array but now I need to print out...
View ArticleAlphanumeric string sorting in an array question
So I have an array that stores alphanumeric strings e.g A1-A9, B1-B9 ... F1-F9 etc. The strings are a record item from a file. However due to the nature of the program the items may not be in the...
View Articletime decrementer from serviceTime()
Back to this grocery line queue program, I have created in the Customer class a getServiceTime() which creates a random number between 1 and 5, in the main class the service time is decremented until...
View ArticleWhy does "if (rs.next()) {" not working properly?
I tried these code but it doesn't do what it supposed to do, it doesn't check wether my credentials matched with the ones stored in the database. "if(rs.next()){" should check if there's a matching row...
View Article