Help me again pls !
Hello ppl! I have a another assignment that I need some help with. I'm supposed to write some program that calculates a sequence of numbers using the fibonacci (I'm not joking this is what my tutor said it was called) sequence where the 0th and 1st numbers are 1 and print the first 5 numbers that are greater than 100 to the console. He said I should do it in 'recursion' (like, whatever! It's hard enough without doing it in french or something). Can someone help me pls because it has to be finished today.
Thanx!
JS
She didn't learn her lesson the first time. Check out her last post in her user profile.
To Re-iterate:
Anyone who has payed attention in ANY Computer Class will know how to do this.
Anyone who DID NOT pay attention, but has the textbook and is willing to read it, can figure it out.
Anyone who misses class, and has never cracked open the textbook posts to Java forum:
"URGENT!!!! PLZ HLP!!! END OF WORLD COMING UNLESS I SOLVE THIS PROBLEM!!!!
Hi. I have to ________________________. Please do it for me. Thx.
Note: If you must choose the last option at least don't insult us by lying to us. Tell us the truth.
e.g.
Hi. I'm too lazy to do my assignment, and I have no knack for computers. But I still think I deserve my degree. Here's my problem, please solve it.
Good luck.
Similar Messages
-
How do I delete my old iMessage email and change to my current one, that Im using when I buy apps and so on. The old one wont go away when I turn iMessage on and of again. pls help
Anyone had the same?How do I delete my old iMessage email and change to my current one, that Im using when I buy apps and so on. The old one wont go away when I turn iMessage on and of again. pls help
Anyone had the same? -
I've used firefox for a month now but recently if I type on facebook the quick find search bar pops out. Even if I press Esc, when i type on facebook again the quick find bar pops out again. pls help..
even when i click the register on the top right of mozilla it wont allow me to.I've used firefox for a month now but recently if I type on facebook the quick find search bar pops out. Even if I press Esc, when i type on facebook again the quick find bar pops out again. pls help..
even when i click the register on the top right of mozilla it wont allow me to. -
hi, my iphone is not connecting to wifi. there is no problem with the connection of wifi. i tried so much but the connection is not stable. some times it connect and sometimes not connecting at all. if connected also its disconnecting again.pls help
At the very least, I recommend you restart your router, (your internet box).
More detail on your problem is needed - are you in a submarine? On the moon? On a tropical island?
You can help yourself by providing as much info as you can about your present situation - what kind of router do you have? Have you moved it? DId you update it? Did you do anything to change your setup, and if you did, what? -
This happens not infrequently. When it does I routinely apply Dr.Smoke's remedy of trashing 3 library files and rebooting and Mac Help works again.
However this time it displayed the alpha index but declined to open the page corresponding to the letter I chose.
I wonder if there is a further treatment that could wake up this help file, or a test to pinpoint the cause of the dysfunction?1. You wrote: "tep 3 of Solution 3 of "Help Viewer links do not work" refers to Incompatible Startup or Login Items, for which the recommanded solution is to update to Mac OS X 10.4.6 or later and then reset Help Viewer"No: that's incorrect. Step 2 refers to the update. Step 3 refers to "Rule out incompatible Startup or Login Items" and refers you to my "Troubleshooting Startup and Login Items" FAQ.
Seems you've not performed Step 2, either, which will probably solve the problem permanently.
2. You wrote: "Quote:To display the toolbar for Help Viewer, click the elliptical button at the far right in the title bar of the Help Viewer window.Unquote
There is no elliptical button at the far right of the title bar. only the Ask a Question field (typing a word in it sets the spinning wheel turning endlessly)
I cannot control click the HelpViewer toolbar to customize it."Once again, you are misreading the FAQ. The item you quote from above is from the section entitled "Help Viewer does not display a search field under Mac OS X 10.3 or earlier" in the FAQ. That's a new section and follows the section on "Help Viewer links do not work". You should be able to tell it's a new section as the title is larger, i.e. its a new heading. There are links to the individual sections at the start of the FAQ, but the sections run linearly throughout the FAQ.
That new section obviously does not apply to Tiger (Mac OS X 10.4) since it states "Mac OS X 10.3 and Earlier." Under Tiger, Help Viewer's toolbar cannot be customized. That feature was only available in Panther (10.3) and earlier. Likewise, it does not apply to your current problem, but a different problem.
My FAQ covers Help Viewer for Mac OS X 10.2 (Jaguar), Mac OS X 10.3 (Panther), and Mac OS X 10.4 (Tiger). The titles of sections or the details within a section can be version-specific and are noted accordingly.
3. You wrote: "Should I rebuild the OSX desktop? (I have a utility by that name). or go ahead an update to OS 10.4.7?
http://www.apple.com/support/downloads/macosxupdate1047comboppc.html says it is 145Mb!!! "Neither.
You should update to Mac OS X 10.7 using Software Update, which will download just the changes you need for the update. You do not need to download the Combo Update to perform an update.
Some people recommend always downloading and installing the Combo Update. I do not: I think that approach is a waste of time.
4. You wrote: "I am a little reluctant to update because it often creates more problems than it cures."That has not been my experience. While there are often many posts here on the Discussions about "problems caused by an update" they are usually the result of self-inflicted wounds:
• People install updates on already-corrupted systems, making a bad problem worse.
• They are running third-party software, often hacks and interface modifications relying on undocumented features of the OS, that are rendered incompatible with the update.
Granted, some updates have had bugs, but I've personally found that most post-update problems are the the result of user errors or a lack of maintenance, rather than problems with the update.
If your system is properly maintained and not "hacked-up" then you should not have any problems with Software Updates.
Before installing software updates, you may wish to consider the advice in my "Installing Software Updates" FAQ. Taking the steps therein before installing an update often helps avert problems and gives you a fallback position in case trouble arises.
Good luck!
Dr. Smoke
Author: Troubleshooting Mac® OS X
Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
I may receive some form of compensation, financial or otherwise, from my recommendation or link. -
I have Mac OS X version 10.5.8 and so im wondering what is the next step i need to get. i have tried to get snow leopard and other things and not having any lukck . can any one help me out pls.
If your Mac meets these requirements:
http://support.apple.com/kb/SP575
then you can order a Snow Leopard disk and install it.
http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
Ciao. -
After effect 2014 is crashing again and again pls... help
My after effects 2014 is crashing again and again after applying any effect
my laptop config. is as follow
Model alienware 17x r4
i7 extreme edition
16gb ram
1.5tb hard disk
2gb nvidia 660
windows 8.1
Pls.....help its urgentUpdate your graphics driver. Anything beyond that would require much more info about your project settings, footage used and whatnot.
Mylenium -
lost a shortcut for one of my apps but it shows up in the app store as purchased how do I get the shortcut back, pls help iphone 4
Hi newyorker2014,
I apologize, I'm a bit unclear on the exact nature of your issue. If you are no longer seeing the app in question on your iPhone, but it is showing as purchased on the App Store, you should be able to redownload it directly. You may find the following article helpful:
Download past purchases
http://support.apple.com/kb/ht2519
Regards,
- Brenden -
Tax Calulator applet again pls help urgent
why isn't it possible to pass a string and a double into GetResult below, i get a compilation error and right now i dunno how to proceed. GetRelief is supposed to calculate "relief" from textfields i/p and GetResult is suppose to calculate the "result" (minus "relief" from GetRelief). And is it the correct way to create an object as in calc = new Calculate(); below................any help would be greatly appreciated...
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class TaxCal extends Applet implements ActionListener {
private TextField income, age, child, parent, course, maid, pay;
private Button b2, b3;
private Calculate calc;
public void init() {
setBackground(Color.lightGray);
/* Create the input boxes, and make sure that the background
color is white. (On some platforms, it is automatically.) */
income = new TextField(10);
Panel incomePanel = new Panel();
incomePanel.setLayout(new BorderLayout(2,2));
incomePanel.add( new Label("Input your annual income"), BorderLayout.WEST );
incomePanel.add(income, BorderLayout.CENTER);
age = new TextField(2);
Panel agePanel = new Panel();
agePanel.setLayout(new BorderLayout(2,2));
agePanel.add( new Label("Input your age"), BorderLayout.WEST );
agePanel.add(age, BorderLayout.CENTER);
child = new TextField(2);
Panel childPanel = new Panel();
childPanel.setLayout(new BorderLayout(2,2));
childPanel.add( new Label("Number of children"), BorderLayout.WEST );
childPanel.add(child, BorderLayout.CENTER);
parent = new TextField(1);
Panel parentPanel = new Panel();
parentPanel.setLayout(new BorderLayout(2,2));
parentPanel.add( new Label("Number of parent that live with you"), BorderLayout.WEST );
parentPanel.add(parent, BorderLayout.CENTER);
course = new TextField(5);
Panel coursePanel = new Panel();
coursePanel.setLayout(new BorderLayout(2,2));
coursePanel.add( new Label("Course fee"), BorderLayout.WEST );
coursePanel.add(course, BorderLayout.CENTER);
maid = new TextField(5);
Panel maidPanel = new Panel();
maidPanel.setLayout(new BorderLayout(2,2));
maidPanel.add( new Label("Maid levy paid"), BorderLayout.WEST );
maidPanel.add(maid, BorderLayout.CENTER);
pay = new TextField(10);
pay.setEditable(false);
Panel payPanel = new Panel();
payPanel.setLayout(new BorderLayout(2,2));
payPanel.add( new Label("Please pay"), BorderLayout.WEST );
payPanel.add(pay, BorderLayout.CENTER);
Panel buttonPanel = new Panel();
buttonPanel.setLayout(new GridLayout(1,3));
Button b2 = new Button("Reset");
b2.addActionListener(this); // register listener
buttonPanel.add(b2);
Button b3 = new Button("Calculate");
b3.addActionListener(this); // register listener
buttonPanel.add(b3);
/* Set up the layout for the applet, using a GridLayout,
and add all the components that have been created. */
setLayout(new GridLayout(8,2));
add(incomePanel);
add(agePanel);
add(childPanel);
add(parentPanel);
add(coursePanel);
add(maidPanel);
add(payPanel);
add(buttonPanel);
/* Try to give the input focus to xInput, which is
the natural place for the user to start. */
income.requestFocus();
} // end init()
public TaxCal() {
calc = new Calculate();
public Insets getInsets() {
// Leave some space around the borders of the applet.
return new Insets(2,2,2,2);
// event handler for ActionEvent
public void actionPerformed (ActionEvent e) {
String s = e.getActionCommand();
if (s.equals("Calculate"))
double relief = calc.GetRelief(age.getText(), child.getText(), parent.getText(), course.getText(), maid.getText());
double result = calc.GetResult(income.getText(), relief);
pay.setText(Double.toString(relief));
else
income.setText("");
age.setText("");
child.setText("");
parent.setText("");
course.setText("");
maid.setText("");
pay.setText("");
} // end actionPerformed()
public class Calculate
private double result;
private double incomeTotal;
private double ageTotal;
private double childTotal;
private double parentTotal;
private double courseTotal;
private double maidTotal;
private double relief;
public Calculate()
relief = 0.0;
result = 0.0;
incomeTotal = 0;
ageTotal = 0;
childTotal = 0;
parentTotal = 0;
courseTotal = 0;
maidTotal = 0;
public double GetResult(String theincome, Double therelief)
incomeTotal = Double.parseDouble(theincome);
relief = therelief;
incomeTotal =- relief;
if (incomeTotal <= 7500)
result = incomeTotal * .02;
else if (incomeTotal > 7500 && incomeTotal <= 20000)
result = 150 + ((incomeTotal - 7500) * .05);
else if (incomeTotal > 20000 && incomeTotal <= 35000)
result = ((incomeTotal - 20000) * .08) + 775;
else if (incomeTotal> 35000 && incomeTotal <= 50000)
result = ((incomeTotal - 35000) * .12) + 1975;
else if (incomeTotal > 50000 && incomeTotal <= 75000)
result = ((incomeTotal - 50000) * .16) + 3775;
else if (incomeTotal > 75000 && incomeTotal <= 100000)
result = ((incomeTotal - 75000) * .2) + 7775;
else if (incomeTotal > 100000 && incomeTotal <= 150000)
result = ((incomeTotal - 100000) * .22) + 12775;
else if (incomeTotal > 150000 && incomeTotal <= 200000)
result = ((incomeTotal - 150000) * .23) + 23775;
else if (incomeTotal > 200000 && incomeTotal <= 400000)
result = ((incomeTotal - 200000) * .26) + 35275;
else if (incomeTotal > 400000)
result = ((incomeTotal - 400000) * .28) + 87275;
return result;
public double GetRelief(String theage, String thechild, String theparent, String thecourse, String themaid)
ageTotal = Double.parseDouble(theage);
parentTotal = Double.parseDouble(theparent);
maidTotal = Double.parseDouble(themaid);
childTotal = Double.parseDouble(thechild);
courseTotal = Double.parseDouble(thecourse);
//determine age relief
if(ageTotal<55)
relief += 3000;
else if(ageTotal>=55 && ageTotal<= 59)
relief += 8000;
else
relief += 10000;
//determine children relief
if(childTotal<=3)
relief += (childTotal*2000);
else if(childTotal>3 && childTotal<6)
relief += ((childTotal-3)*500 + 6000);
else
relief += 0;
//determine parent relief
if(parentTotal == 1)
relief += 3000;
else if(parentTotal ==2)
relief += 6000;
else
relief += 0;
//determine course subsidy
if(courseTotal != 0 ) {
if(courseTotal <= 2500)
relief += courseTotal;
else
relief += 2500;
//determine maid levy
if(maidTotal != 0) {
if(maidTotal <= 4000)
relief += 2 * maidTotal;
else
relief += 0;
return relief;
} // end of class Calculate
} // end class TaxCalYou're probably not getting anything to show up because in your actionPerformed() method, b3 has not been initialized.
You declare static variables:
Button b2, b3;
but then in your init() method, you delare new local variables when you specify:
Button b2 = new Button(...);
Button b3 = new Button(...);
Since you're declaring and initializing the new local variables, you have never set the static variables to any values. Try removing the type declaration for b2 and b3 in your init() method as follows:
b2 = new Button(...)
b3 = new Button(...)
Hope this helps! -
i hav iphone and i restart it and delete all the files inside how can i start it again it say i need a valid sim with no pin lock to activate iphone again
ICCID unknown is a critical failure, usually caused by hacking or jailbreaking the phone. It can not be fixed. The phone will need to be replaced.
-
Prepared statement help... pls...
hey all... need help... this prepared statement is driving me mad... keeps throwing an error in my servlet.... can somebody pls help
PreparedStatement updateWiki = con.prepareStatement("UPDATE sportinfo SET pageinfo,parent = (?,?) WHERE sport LIKE ? ");
updateWiki.setString(1, wikipage);
updateWiki.setString(2, parent);
updateWiki.setString(3, sport);
updateWiki.executeUpdate();
am i missing something???
thanks keith1. What is the error? Please post it.
2. Try using the query like:
UPDATE sportinfo SET pageinfo=?,parent=? WHERE sport LIKE ?
and see if it still fails. -
Need some help with POI pls...
Hi,
I'm currently using POI to generate MS Excel documents from
CF.
I believe it's a great tool because it gave me the
possibility to export the data on different worksheets, etc.
Before using POI, I was just using only CF (see PART 1 in
attached code).
The advantage was that I could display all 3 tables in 1 page
and control their display using plain html.
The disadvantage was that, when the request was to display
each product details on 1 separate worksheet, I was stuck!
And this is where using POI becomes interesting!
However, I've noticed that you can only export 1 query to the
POI, and my question is:
Is there a way to pass more than 1 query to the POI, so that
it displays in the same way as it would using CF (3 different
blocks or tables)?
This is because, even though I have to separate each product
on a separate worksheet, I still need to have the same display i.e.
1 table for the Overall, then a blank column (separator), 1 table
for the "Entries", then a blank column as separator again, and then
1 table for the "Exits". (Forget about the names Overall, Entries
and Exits, this is just an example. I only need to display 3
sections of data on the same sheet).
Now, since I don't know if this is possible or not, I have
tried to work around the problem differently.
What I've done is to create 1 query (see PART 2 in attached
code).
Now, here I've got a big problem, especially if I'm querying
data since inception.
I'm using a MySQL 5.1 database properly partitioned on dates
(yearly) and then properly indexed.
I'm currently using SQLYog Enterprise v5.21 as GUI tool for
my database.
Here are my observations:
1. Querying the data in SQLYog itself takes miliseconds
(around 47ms).
2. Querying the data via a cfquery takes seconds (around 6-7
seconds).
3. Looping through more than 50,000 records to create the
myQry takes around 4-5 mins. If I test it on my PC, I even have to
restart jrun!
Is there any better way to do the following?
1. Populate the myQry.
2. Display the data in 3 "blocks" on each sheet using POI.
Your help will be greatly appreciated :-)
Thanks and regards,
Yogesh MahadnacHi -==cfSearching==-
Many thanks for your reply.
At least I've got one now!
Indeed, I would be very much grateful if you could please
provide me with an example, if possible, via email to
[email protected]
Thanks and regards,
Yogesh Mahadnac. -
i am trying to update the extension manager 6.0,8 i get an error (u44m1p7) any help with this issue please
That the CS6 version
Extension Manager 6.0.8 update
December 10, 2013
Macintosh | Windows
Photoshop: Basic Troubleshooting steps to fix most issues
Troubleshoot Update Errors
Many update errors are caused by missing or modified files required by Photoshop, typically by a disk cleanup utility (Ex: CleanMyMac, MacKeeper, etc). Make sure you have the latest updates for your clean-up utilities or discontinue use.
Explanations of error codes:
U = Updater.
44 = Install Update Error
M1 = Automatic
M2 = Standalone mode
P = Patcher
6 = Done With Errors
7 = Installation Failed
ISSUE: Installation failed. Error Code: U44M1P7, U44M2P7, U44M1P6
SOLUTION: Run the installer. Reinstall Photoshop CS6 to repair/replace the missing/modified file. Select Help>Updates… to run the updater again. http://helpx.adobe.com/creative-suite/kb/error-u44m1p7-installing-updates-ccm.html -
Compilation Help!!Pls offer ur knowledge
Anyone can figure out what wrong with my program>I try to getString name from Eoption1 class location and be display in other interface(Exam class).There is a problem during compilation.Can anyone offer some knowlegde tosee what the problem,,Below are three file .....(Module1.java,Eoption1.java,Exam.java)
Module1.java(main class)
=================
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
public class Module1 extends JFrame {
long startT=0;
Clock2 applet = new Clock2();
public Module1() {
super("Certification Exam");
JMenuBar menubar = new JMenuBar();
JMenu menu = new JMenu("File");
JMenu exam = new JMenu("Exam");
JMenu help = new JMenu("Help");
JMenu type = new JMenu("Type of Exam");
JMenuItem
newitem = new JMenuItem("New ..."),
olditem = new JMenuItem("Old ..."),
exititem = new JMenuItem("Exit ..."),
option = new JMenuItem("Exam Option"),
starte = new JMenuItem("Start Exam");
menu.add(newitem);
menu.add(olditem);
menu.add(exititem);
exam.add(starte);
exam.add("Load Exam");
exam.addSeparator();
exam.add(option);
help.add(type);
help.add("Implementation");
help.add("Update");
type.add("Windows Profesional");
type.add("Windows Server");
type.add("Active Directory");
Container contentPane = getContentPane();
JLabel none = new JLabel("");
JPanel panel = new ImageCanvas("cover2.jpg","LOGO");
panel.setBorder(BorderFactory.createRaisedBevelBorder());
panel.setPreferredSize(new Dimension(495,260));
//panel.setPreferredSize(new Dimension(960,500));
panel.setBounds(20,20,950,500);
applet.setBounds(430,550,150,150);
contentPane.setLayout(new BorderLayout());
contentPane.add(panel,BorderLayout.SOUTH);
contentPane.add(applet,BorderLayout.SOUTH);
contentPane.add(none,BorderLayout.SOUTH);
applet.init();
applet.start();
menubar.add(menu);
menubar.add(exam);
menubar.add(help);
setJMenuBar(menubar);
starte.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Option1();
option.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Optional();
public void Optional() {
Eoption1 option = new Eoption1(this);
startT=option.getStartT();
public void Option1() {
Exam exam = new Exam(startT);
class ImageCanvas extends JPanel {
ImageIcon icon;
public ImageCanvas(String imageName, String description) {
icon = new ImageIcon(imageName, description);
public void paintComponent(Graphics g) {
Insets insets = getInsets();
super.paintComponent(g);
icon.paintIcon(this, g, insets.left, insets.top);
public Dimension getPreferredSize() {
Insets insets = getInsets();
return new Dimension(
icon.getIconWidth() + insets.left + insets.right,
icon.getIconHeight() + insets.top + insets.bottom);
public static void main(String args[]) {
JFrame mod = new Module1();
Toolkit theKit = mod.getToolkit();
Dimension wndSize = theKit.getScreenSize();
mod.setSize(wndSize.width,wndSize.height);
mod.setVisible(true);
mod.setResizable(false);
mod.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Eoption1.java
==================
import java.math.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Eoption1 extends JDialog implements ActionListener {
JComboBox combo = new JComboBox();
long startT=0;
public Eoption1(Frame parent) {
super(parent, "Server 1.2-1", true);
Container contentPane = getContentPane();
JLabel label1 = new JLabel("Examinee Name");
JButton start = new JButton("Submit");
JTextField name = new JTextField(30);
String stuName;
start.setEnabled(false);
combo.addItem(" No Timer");
combo.addItem("30 Minutes");
combo.addItem("60 Minutes");
combo.addItem("90 Minutes");
combo.addItem("120 Minutes");
combo.addItem("150 Minutes");
combo.addItem("180 Minutes");
combo.setSelectedIndex(0);
start.addActionListener(new ActionListener() {
public void actionPerformed( ActionEvent e ) {
try {
startT = combo.getSelectedIndex();
if (startT == 0) {
// do something
stuName = (String) name.getText();
startT = -1; // Impossible to get -1 from this calcs, so we set it so we can check it later
} else {
startT *= 30*60*1000;
stuName = (String) name.getText();
dispose();
return;
catch (Throwable fe) {}
contentPane.setLayout(null);
contentPane.add(label1);
contentPane.add(name);
contentPane.add(start);
contentPane.add(combo);
name.addActionListener(this);
label1.setBounds(30,10,100,30);
name.setBounds(140,10,150,25);
start.setBounds(30,50,100,25);
combo.setBounds(150,50,130,25);
Dimension wndSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(wndSize.width/4, wndSize.height/4,wndSize.width/2, wndSize.height/2);
setVisible(true);
public void keyTyped(KeyEvent e) { }
public void keyPressed(KeyEvent e) { }
public void keyReleased(KeyEvent e) {
if((name.getText().length() > 0)
start.setEnabled(true);
else
start.setEnabled(false);
public long getStartT() {return startT;}
Exam.java
==========================
import javax.swing.*;
import java.awt.*;
import java.text.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.border.*;
public class Exam extends JFrame {
javax.swing.Timer timer;
JTextField time = new JTextField("");
String stuName;
long startT,stopT;
SimpleDateFormat timef = new SimpleDateFormat(" HH:mm:ss ",Locale.getDefault());
Exam(long start,String stuName) {
super("Exam");
startT=start;
this.stuName = stuName;
Date date=new Date();
timef.setTimeZone(TimeZone.getTimeZone("GMT"));
Container contentPane = getContentPane();
String content = "";
JLabel namedisplay = new JLabel("");
JPanel panel = new JPanel();
JTextArea textArea = new JTextArea(content,10,30);
textArea.setLineWrap(true);
textArea.setEditable(false);
time.setBounds(300,400,70,25);
time.setOpaque(true);
time.setEditable(false);
panel.setBorder(BorderFactory.createTitledBorder("Read the following"));
panel.add(textArea);
panel.setBounds(100,50,500,250);
namedisplay.setText(stuName);
namedisplay.setBounds(300,350, 100, 25);
contentPane.setLayout(null);
contentPane.add(panel);
contentPane.add(time);
contentPane.add(namedisplay);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
if (startT > 0) {
startT+=System.currentTimeMillis();
timer = new javax.swing.Timer(1000, new ActionListener() {
public void actionPerformed(ActionEvent e) {
stopT = System.currentTimeMillis();
time.setText(timef.format(new Date(startT-stopT)));
timer.start();
} else {
// Running with no timer, do something here to let them know.
// set the time.setText("00:00:00"); or whatever you want it to sit at
setVisible(true);
Dimension wndSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(wndSize.width/10, wndSize.height/10,800,600);Dear VV..
i have try to compile using your way and it does works,but got somemore problem trouble me,I have try to getString where the exammiinee name from Eoption class but it can;t store to be display in the Exam class.I have already declare all the variable but it doesn;t run.Can you pls help..Below are the code.where it got three file (Exam,MOdule1,Eoption).There is a applet code Clock2 ,u may // it first..
Exam.java
==============
import javax.swing.*;
import java.awt.*;
import java.text.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.border.*;
public class Exam extends JFrame {
javax.swing.Timer timer;
JTextField time = new JTextField("");
String stuName;
long startT,stopT;
SimpleDateFormat timef = new SimpleDateFormat(" HH:mm:ss ",Locale.getDefault());
public Exam(long start,String stuName) {
super("Exam");
startT=start;
this.stuName = stuName;
Date date=new Date();
timef.setTimeZone(TimeZone.getTimeZone("GMT"));
Container contentPane = getContentPane();
String content = "";
JLabel namedisplay = new JLabel("");
JPanel panel = new JPanel();
JTextArea textArea = new JTextArea(content,10,30);
textArea.setLineWrap(true);
textArea.setEditable(false);
time.setBounds(300,400,70,25);
time.setOpaque(true);
time.setEditable(false);
panel.setBorder(BorderFactory.createTitledBorder("Read the following"));
panel.add(textArea);
panel.setBounds(100,50,500,250);
namedisplay.setText(stuName);
namedisplay.setBounds(300,480, 100, 25);
contentPane.setLayout(null);
contentPane.add(panel);
contentPane.add(time);
contentPane.add(namedisplay);
setResizable(false);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
if (startT > 0) {
startT+=System.currentTimeMillis();
timer = new javax.swing.Timer(1000, new ActionListener() {
public void actionPerformed(ActionEvent e) {
stopT = System.currentTimeMillis();
time.setText(timef.format(new Date(startT-stopT)));
timer.start();
} else {
// Running with no timer, do something here to let them know.
// set the time.setText("00:00:00"); or whatever you want it to sit at
setVisible(true);
Dimension wndSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(wndSize.width/10, wndSize.height/10,800,600);
Eoption1.java
========================
import java.math.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Eoption1 extends JDialog implements ActionListener{
JComboBox combo = new JComboBox();
Exam x = new Exam(0L,"");
long startT=0;
JTextField name = new JTextField(30);
String stuName;
JButton start = new JButton("Submit");
public Eoption1(Frame parent) {
super(parent, "Server 1.2-1", true);
Container contentPane = getContentPane();
JLabel label1 = new JLabel("Examinee Name");
JButton start = new JButton("Submit");
combo.addItem(" No Timer");
combo.addItem("30 Minutes");
combo.addItem("60 Minutes");
combo.addItem("90 Minutes");
combo.addItem("120 Minutes");
combo.addItem("150 Minutes");
combo.addItem("180 Minutes");
combo.setSelectedIndex(0);
start.addActionListener(this);
contentPane.setLayout(null);
contentPane.add(label1);
contentPane.add(name);
contentPane.add(start);
contentPane.add(combo);
name.addActionListener(this);
label1.setBounds(30,10,100,30);
name.setBounds(140,10,150,25);
start.setBounds(30,50,100,25);
combo.setBounds(150,50,130,25);
Dimension wndSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(wndSize.width/4, wndSize.height/4,wndSize.width/2, wndSize.height/2);
setVisible(true);
public void actionPerformed(ActionEvent e) {
try {
startT = combo.getSelectedIndex();
if (startT == 0) {
// do something
stuName = (String) name.getText();
startT = -1; // Impossible to get -1 from this calcs, so we set it so we can check it later
} else {
startT *= 30*60*1000;
stuName = (String) name.getText();
dispose();
return;
catch (Throwable fe) {}
public long getStartT() {return startT;}
public void keyPressed(KeyEvent e) { }
public void keyReleased(KeyEvent e) {
if((name.getText().length() > 0))
start.setEnabled(true);
else
start.setEnabled(false);
public void keyTyped(KeyEvent e) { }
Module1.java(main class)
=========
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
public class Module1 extends JFrame {
long startT=0;
String stuName;
Clock2 applet = new Clock2(); // Unknown
class ImageCanvas extends JPanel {
ImageIcon icon;
public ImageCanvas(String imageName, String description) {
icon = new ImageIcon(imageName, description);
public void paintComponent(Graphics g) {
Insets insets = getInsets();
super.paintComponent(g);
icon.paintIcon(this, g, insets.left, insets.top);
public Dimension getPreferredSize() {
Insets insets = getInsets();
return new Dimension(
icon.getIconWidth() + insets.left + insets.right,
icon.getIconHeight() + insets.top + insets.bottom);
public Module1() {
super("Certification Exam");
JMenuBar menubar = new JMenuBar();
JMenu menu = new JMenu("File");
JMenu exam = new JMenu("Exam");
JMenu help = new JMenu("Help");
JMenu type = new JMenu("Type of Exam");
JMenuItem
newitem = new JMenuItem("New ..."),
olditem = new JMenuItem("Old ..."),
exititem = new JMenuItem("Exit ..."),
option = new JMenuItem("Exam Option"),
starte = new JMenuItem("Start Exam");
menu.add(newitem);
menu.add(olditem);
menu.add(exititem);
exam.add(starte);
exam.add("Load Exam");
exam.addSeparator();
exam.add(option);
help.add(type);
help.add("Implementation");
help.add("Update");
type.add("Windows Profesional");
type.add("Windows Server");
type.add("Active Directory");
Container contentPane = getContentPane();
JLabel none = new JLabel("");
JPanel panel = new ImageCanvas("cover2.jpg","LOGO");
panel.setBorder(BorderFactory.createRaisedBevelBorder());
panel.setPreferredSize(new Dimension(495,260));
//panel.setPreferredSize(new Dimension(960,500));
panel.setBounds(20,20,950,500);
applet.setBounds(430,550,150,150);
contentPane.setLayout(new BorderLayout());
contentPane.add(panel,BorderLayout.SOUTH);
contentPane.add(applet,BorderLayout.SOUTH);
contentPane.add(none,BorderLayout.SOUTH);
applet.init();
applet.start();
menubar.add(menu);
menubar.add(exam);
menubar.add(help);
setJMenuBar(menubar);
starte.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Option1();
option.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Optional();
public static void main(String args[]) {
JFrame mod = new Module1();
Toolkit theKit = mod.getToolkit();
Dimension wndSize = theKit.getScreenSize();
mod.setSize(wndSize.width,wndSize.height);
mod.setVisible(true);
mod.setResizable(false);
mod.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public void Option1() {
Exam exam = new Exam(startT,stuName);
public void Optional() {
Eoption1 option = new Eoption1(this);
startT=option.getStartT(); -
Help in syntax pls.?
Hello
For some reason, i am using a variable in place of a FIELD, while doing of referring a text field expression syntax, working fine, the syntax is as below shown in (1)*
var myVariable
myVariable = myTextField
(1)* xfa.resolveNode("VISITOR.Page3.SubFrom1." + myVariable + "").access = "readOnly";
Now,
I want to use a vatriable in place(in stead) of COMPLETE text field expression syntax , pls. let me know its syntax(i tries with the below syntax, its not working), as shown in (1)* the above syntax
xfa.resolveNode(myVariable).access = "readOnly";
Thank youHi,
Your syntax is correct the problem is that It doesn't look like you have change the variable to be the entire path, so for the code
xfa.resolveNode(myVariable).access = "readOnly";
the myVariable would have to be set to be
myVariable = "VISITOR.Page3.SubFrom1.myTextField";
Hope this helps
Malcolm
Maybe you are looking for
-
Hi, I have a new macbook that used to have dvi plug and I could use the adapter to plug into rca or svideo. The plug is on the following website: http://store.apple.com/us/product/M9267G/A However, the new mac only has a mini dvi adapter, and I need
-
ok, I'm not getting any replies and my last submission came back that it couldn't be delivered , what is going on
-
Is this a good design pattern?
Hi, I am working with a team to create an application that can acquire data from up to 24 thermcouple channels. We plan to create a wizard to assist the user in setting up the test (specifiying stop conditions, sample rate, channels to sample, outpu
-
Hi Gurus, What is the Major changes that will happen when we create More ( more than one ). sales Organisations. Any extra assignments will come or any FI enties will happen? Give me the detail view. Wt are the advantages and disadvatages when we cre
-
WRT54G2 V1 - Internet randomly disconnecting
So when am downloading an application or music anything like for example a game patch that is like 100mb big it disconnects of the network, but any other computer on the network which is wireless by the way stays connected and can still download. Why