No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
[CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class SwingAnimation{ Thread th; ImageIcon images; JFrame frame; JLabel lbl; int i = 0; int j; public static void main(String[] args){ SwingAnimation sa = new SwingAnimation(); } public SwingAnimation(){ frame = new JFrame("Animation Frame"); th = new Thread(); lbl = new JLabel(); Panel … |
|
How to let the button set to it "latest" text because i suppose to set the button's text to "booked" and the foreground to red. However, everytime i re-run the program, the button re-set. I know i should do something on constructor, but how? Here is my coding.. Thanks for … |
|
I suppose to write the records to a text file. However every time i re-log in and add a record.The previous record will be rewrite. >.<'' [CODE]public void addRecords(){ getInfo(); FileWriter fWriter = null; BufferedWriter writer = null; try { fWriter = new FileWriter("PassengerInfo.txt"); writer = new BufferedWriter(fWriter); writer.write(name); writer.write(";"); … |
|
i[CODE]mport javax.swing.*; public class ReverseArray { public static void reverse(int b[]){ int left = 0; int right = b.length -1; while(left<right){ //exchange the left and right elements int temp = b[left]; b[left] = b[right]; b[right] = temp; left++; right--; } } public static void main(String a[]){ } } [/CODE] how … |
|
[CODE]public class Human { private String name; public Human(String name){ this.name = name; } public String getName(){ return name; } public String toString(){ return "Human " + getName(); } } interface Electrician{ public String changeBulb(); } interface Plumber{ public String unplugDrain(); } class HandyPerson extends Human implements Electrician, Plumber{ public … |
|
Can anyone teach me how to assign a empty array to zero? Which means that some of the c[x][y] have not assigned to a value. [CODE]int x = 4; int y = 4; a[x] = {30,40,50,60}; b[y] = {100,20,60,40}; c[x][y]; int i = 0; int j = 0; while(i<x && … |
|
sorry that i don't know i post on a correct place or not..=D my question is: How can i use the adjacency matrix like A B A 0 1 B 1 0 and write it to form of adjacency list like A -> B B -> A Hope you all … |
|
I am learning the OOP recently and i have a few questions to ask 1) When should i use operator overloading? 2) When should i use template? |
|
i think this part got problem..anyone can guide me? [CODE]ifstream BanKing; BanKing.open("BankData.txt"); while (!BanKing.eof()) { BanKing>>loginName; BanKing>>password; if(loginName == loginName1 && password == password1) { menu(); break; } else { cout<<"\tUnregistered ID or you have enter a wrong password !"<<endl; cin.clear(); cin.ignore(); getchar(); return ; } BanKing.close(); } }[/CODE] i … |
|
Can anyone guide me how to solve for the login problem..i think is the read file problem.. I try many ways but can't. here the code: [CODE]#include <iostream> #include <string> #include <fstream> #include <cstdlib> #include <cmath> #include <windows.h> using namespace std; class bankAccount { private: string name, loginName,loginName1; float IDnum; … |
|
[CODE]#include <iostream> #include <cstring> using namespace std; int numberOfDeposit, numberOfWithdrawal; double monthlyInterestRate, monthlyInterest; float totalAmount; double MonthlyServiceCharge; int selections, choices, functions; string name, address, loginID; int idNum, password; class bankAccount { public: bankAccount() { float balance; double annualInterestRate; } float thismonthDeposit; float thismonthwithdrawal; float balance; float getbalance() { return balance; … |