PLEASE HELP...how do i exit a programme
I am having some trouble with a programme i have been coding -
I am fairly new to Java and have a quick query!
How would i exit my programme in the middle of my code...
eg
if (a = 5)
System.out.println("you win");
else
...rest of code!EG I would like to end the programme when the user meets the requirements of the IF statement -
if (a = 5)If the user does not meet these requirements i would like them to go onto the next question.
so i need it to end:
else
question2... etcAt the moment - even if the requirements in the IF statement are met - the programme continues to run to the next question!
i understand i could use
System.exit(0)but i dont know if this is right?
Any help would be appreciated!
thanks!
Hm... confusion still remains....
Look.... once your main() method returns, your app is more or less dead, (certain pieces of the jvm remain for a short period thereafter...)... SO
If your code steps through to the FINAL CLOSING BRACE in your main method, you have exited your app...
System.exit() is used in abnormal cases where you need to force the issue in a hurry, (un-recoverable exeptions, OOM errors,etc...).
Be aware that swing and awt objects could leave the app open unless you specify a default close op or disposal...
Similar Messages
-
Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with 6.0.1(10A523)version. Please help how to solve this problem. Thanks.
Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore. -
Please help me with user-exits or baids for TCode : FOE2 & FOE1
Hi Experts
Please help me with user-exits or baids for TCode : FOE2 & FOE1.
I found these but not picking values from VIMI01,VIOB03 and VIOB41.
User-exits
FVCH0001 CH-specific enhancements: Esp. POR
ISRE0001 Determine bank procedure account no.
ISRE0002 IPD reporting data retrieval
Business Add-in
FVD_HANDLE_FORMULA Processing of Condition FormulasHi,
ASk your basis regarding the CI_CSKB table active issue, and first of all i dont see any table with the name CI_CSKB.
And check this exit-COOMKS03 whether it works for your screen exits.
Cheers!!
VEnk@
Edited by: Venkat Reddy on Nov 4, 2008 5:59 PM -
after updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid good money for this mack, I feel calm
Hi Buterem,
I'm sorry to hear you are having issues with your MacBook Pro since your recent Yosemite update. I also apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are having intermittent but persistent responsiveness issues with your mouse or trackpad, you may want to try using Activity Monitor to see if these incidents correspond to occupied system resources, especially system memory or CPU. You may find the following article helpful:
How to use Activity Monitor - Apple Support
If the entire system hangs or locks up (for example, if the system clock freezes and stops counting up), you may also be experiencing some variety of Kernel Panic. If that is the case, you may also find this article useful:
OS X: When your computer spontaneously restarts or displays "Your computer restarted because of a problem." - Apple Support
Regards,
- Brenden -
i have just updated my old 3GS and now when i am on restore the window is comming up and asking for a password. i have not set up a password for restore, please help how i can restore my date???
capriz wrote:
i have just updated my old 3GS ...
To what... iOS 7 is Not supported on the 3 GS -
Please Help,how do i get my iphone 4 to play all my songs from icloud, it is currently only playing just a smal number of songs from my library which is stored in icloud.
There are a number of OS X apps, many free, that will save your messages, allowing to view and print them.
http://www.softwarebbs.com/wiki/How_to_transfer_SMS_from_iPhone_to_Mac,_backup_i Phone_SMS_message_on_Mac
Google, for other options
Your "other" of 6 GB may include corrupted data or file sytem errors. If after removing the messages there is still >2GB, you will need to restore the phone in iTunes, first using a backup (made after deleting the messages) and if needed as a new iPhone.
iTunes: Restoring iOS software -
I bought a used iphone from a friend and I am not able to use it in Ethiopia. It is carrier blocked. Can you please help how could I unlock my iphone 4?.
Unlikely as you do not meet there requirements for unlocking.
Have your friend the provided the phone contact them. Based on your statements I am concluding he was or still is an AT&T customer, that is one of the requirements of getting the device unlocked. -
Hello,
I forget my passcode please help how can I get my itYou will need to try to restore your iPad from the same computer that you most recently synced to.
Read this: http://support.apple.com/kb/ht1212
If you can't do the restore then you will need to try Recovery Mode.
Read this: http://support.apple.com/kb/ht1808
Follow the instructions very carefully. -
i have windows 8 and I got this error "Adobe Photoshop has stopped working" whenever I start a program. please help. how can I fix this problem? many thanks
Please read these and proceed accordingly:
http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
http://forums.adobe.com/docs/DOC-2325 -
want to cahage my peyment method ( i wana do take out my credit card from there) please help how???
You can't change to 'None' until you clear up the previous payment problem. Add a fresh iTunes gift card, or add a credit card, and then once the billing issue clears, you can choose 'None' again.
-
hi, my daughter hers ipod touch is disabled connect to itunes after say its itunes couldnot connect to the "ipod touch" because its is locked with a passcode please help how to fix connect...i did turn off her ipod touch put usb back on there same in doenot say still ipod is disabled i dont understand please help how???
If You Are Locked Out Or Have Forgotten Your Passcode or Just Need to Restore Your Device
1. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
3. iOS- Understanding passcodes
If you have forgotten your Restrictions code, then follow the instructions
below but DO NOT restore any previous backup. If you do then you will
simply be restoring the old Restrictions code you have forgotten. This
same warning applies if you need to restore a clean system.
A Complete Guide to Restore or Recover Your iDevice (if You Forget Your Passcode)
If you need to restore your device or ff you cannot remember the passcode, then you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and re-sync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone, iPad and iPod touch software.
Try restoring the iOS device if backing up and erasing all content and settings doesn't resolve the issue. Using iTunes to restore iOS devices is part of standard isolation troubleshooting. Restoring your device will delete all data and content, including songs, videos, contacts, photos, and calendar information, and will restore all settings to their factory condition.
Before restoring your iOS device, Apple recommends that you either sync with iTunes to transfer any purchases you have made, or back up new data (data acquired after your last sync). If you have movie rentals on the device, see iTunes Store movie rental usage rights in the United States before restoring.
Follow these steps to restore your device:
1. Verify that you are using the latest version of iTunes before attempting to update.
2. Connect your device to your computer.
3. Select your iPhone, iPad, or iPod touch when it appears in iTunes under Devices.
4. Select the Summary tab.
5. Select the Restore option.
6. When prompted to back up your settings before restoring, select the Back Up
option (see in the image below). If you have just backed up the device, it is not
necessary to create another.
7. Select the Restore option when iTunes prompts you (as long as you've backed up,
you should not have to worry about restoring your iOS device).
8. When the restore process has completed, the device restarts and displays the Apple
logo while starting up:
After a restore, the iOS device displays the "Connect to iTunes" screen. For updating
to iOS 5 or later, follow the steps in the iOS Setup Assistant. For earlier versions of
iOS, keep your device connected until the "Connect to iTunes" screen goes away or
you see "iPhone is activated."
9. The final step is to restore your device from a previous backup. If you do not have a
backup to restore, then restore as New.
If you are restoring to fix a forgotten Restrictions Code or as a New device, then skip Step 9 and restore as New. -
Hi,
Please help
How can I install flash player plugin (version 8) in browser
without
downloading setup or redirecting to macromedia site if flash
plugin is not
available in browser
ThanksVia Javascripting. Look for Flash detection kits at the
Adobe/Maromedia web
site and also at Internet search engines.
As well this forum focuses on database access issues and you
might find more
takers for this type of question in the Flash General forum.
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
"jiby" <[email protected]> wrote in message
news:e3odp2$pdc$[email protected]..
Hi,
Please help
How can I install flash player plugin (version 8) in browser
without
downloading setup or redirecting to macromedia site if flash
plugin is not
available in browser
Thanks -
iPhoto app stops responding upon launch. Please help how I can fix this problem., iPhoto app stops responding upon launch. Please help how I can fix this problem.
Please clarify:
What is your iPhoto version?
And what do you mean by "not responding"? Is iPhoto hanging and showing the spinning beachball?
Can you launch iPhoto, if you hold down the options key while launching and select or create a different library? -
Please help how to execute jfree......
please help how to execute[b] jfree programs
step by step procedure.....
package org.jfree.chart.demo;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPosition;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.CategoryLabelWidthType;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.text.TextBlockAnchor;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RectangleAnchor;
import org.jfree.ui.RefineryUtilities;
import org.jfree.ui.TextAnchor;
import org.jfree.util.Log;
import org.jfree.util.PrintStreamLogTarget;
* A simple demonstration application showing how to create a horizontal 3D bar chart using data
* from a {@link CategoryDataset}.
public class BarChart3DDemo2 extends ApplicationFrame {
// * JFREECHART DEVELOPER GUIDE *
// * The JFreeChart Developer Guide, written by David Gilbert, is available *
// * to purchase from Object Refinery Limited: *
// * http://www.object-refinery.com/jfreechart/guide.html *
// * Sales are used to provide funding for the JFreeChart project - please *
// * support us so that we can continue developing free software. *
* Creates a new demo.
* @param title the frame title.
public BarChart3DDemo2(final String title) {
super(title);
// create the chart...
final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(23.0, "Series 1", "London");
dataset.addValue(14.0, "Series 1", "New York");
dataset.addValue(14.0, "Series 1", "Istanbul");
dataset.addValue(14.0, "Series 1", "Cairo");
dataset.addValue(13.0, "Series 2", "London");
dataset.addValue(19.0, "Series 2", "New York");
dataset.addValue(19.0, "Series 2", "Istanbul");
dataset.addValue(19.0, "Series 2", "Cairo");
dataset.addValue(7.0, "Series 3", "London");
dataset.addValue(9.0, "Series 3", "New York");
dataset.addValue(9.0, "Series 3", "Istanbul");
dataset.addValue(9.0, "Series 3", "Cairo");
final JFreeChart chart = createChart(dataset);
// add the chart to a panel...
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
* Creates a chart.
* @param dataset the dataset.
* @return The chart.
private JFreeChart createChart(final CategoryDataset dataset) {
final JFreeChart chart = ChartFactory.createBarChart3D(
"3D Bar Chart Demo 2", // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.HORIZONTAL, // orientation
true, // include legend
true, // tooltips
false // urls
final CategoryPlot plot = chart.getCategoryPlot();
plot.setForegroundAlpha(1.0f);
// left align the category labels...
final CategoryAxis axis = plot.getDomainAxis();
final CategoryLabelPositions p = axis.getCategoryLabelPositions();
final CategoryLabelPosition left = new CategoryLabelPosition(
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
TextAnchor.CENTER_LEFT, 0.0,
CategoryLabelWidthType.RANGE, 0.30f
axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
return chart;
* Starting point for the demonstration application.
* @param args ignored.
public static void main(final String[] args) {
Log.getInstance().addTarget(new PrintStreamLogTarget());
final BarChart3DDemo2 demo = new BarChart3DDemo2("3D Bar Chart Demo 2");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);
}this is the first time i'm trying to execute jfree programs...
regards,
R.Raghavanhere's error message
E:\raghav>javac BarChart3DDemo2.java
BarChart3DDemo2.java:3: cannot find symbol
symbol : class ChartFactory
location: package org.jfree.chart
import org.jfree.chart.ChartFactory;
^
BarChart3DDemo2.java:4: cannot find symbol
symbol : class ChartPanel
location: package org.jfree.chart
import org.jfree.chart.ChartPanel;
^
BarChart3DDemo2.java:5: cannot find symbol
symbol : class JFreeChart
location: package org.jfree.chart
import org.jfree.chart.JFreeChart;
^
BarChart3DDemo2.java:6: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.CategoryAxis;
^
BarChart3DDemo2.java:7: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.CategoryLabelPosition;
^
BarChart3DDemo2.java:8: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.CategoryLabelPositions;
^
BarChart3DDemo2.java:9: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.CategoryLabelWidthType;
^
BarChart3DDemo2.java:10: package org.jfree.chart.plot does not exist
import org.jfree.chart.plot.CategoryPlot;
^
BarChart3DDemo2.java:11: package org.jfree.chart.plot does not exist
import org.jfree.chart.plot.PlotOrientation;
^
BarChart3DDemo2.java:12: package org.jfree.data.category does not exist
import org.jfree.data.category.CategoryDataset;
^
BarChart3DDemo2.java:13: package org.jfree.data.category does not exist
import org.jfree.data.category.DefaultCategoryDataset;
^
BarChart3DDemo2.java:14: package org.jfree.text does not exist
import org.jfree.text.TextBlockAnchor;
^
BarChart3DDemo2.java:15: package org.jfree.ui does not exist
import org.jfree.ui.ApplicationFrame;
^
BarChart3DDemo2.java:16: package org.jfree.ui does not exist
import org.jfree.ui.RectangleAnchor;
^
BarChart3DDemo2.java:17: package org.jfree.ui does not exist
import org.jfree.ui.RefineryUtilities;
^
BarChart3DDemo2.java:18: package org.jfree.ui does not exist
import org.jfree.ui.TextAnchor;
^
BarChart3DDemo2.java:19: package org.jfree.util does not exist
import org.jfree.util.Log;
^
BarChart3DDemo2.java:20: package org.jfree.util does not exist
import org.jfree.util.PrintStreamLogTarget;
^
BarChart3DDemo2.java:27: cannot find symbol
symbol: class ApplicationFrame
public class BarChart3DDemo2 extends ApplicationFrame {
^
BarChart3DDemo2.java:80: cannot find symbol
symbol : class CategoryDataset
location: class org.jfree.chart.demo.BarChart3DDemo2
private JFreeChart createChart(final CategoryDataset dataset) {
^
BarChart3DDemo2.java:80: cannot find symbol
symbol : class JFreeChart
location: class org.jfree.chart.demo.BarChart3DDemo2
private JFreeChart createChart(final CategoryDataset dataset) {
^
BarChart3DDemo2.java:50: cannot find symbol
symbol : class DefaultCategoryDataset
location: class org.jfree.chart.demo.BarChart3DDemo2
final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
^
BarChart3DDemo2.java:50: cannot find symbol
symbol : class DefaultCategoryDataset
location: class org.jfree.chart.demo.BarChart3DDemo2
final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
^
BarChart3DDemo2.java:64: cannot find symbol
symbol : class JFreeChart
location: class org.jfree.chart.demo.BarChart3DDemo2
final JFreeChart chart = createChart(dataset);
^
BarChart3DDemo2.java:67: cannot find symbol
symbol : class ChartPanel
location: class org.jfree.chart.demo.BarChart3DDemo2
final ChartPanel chartPanel = new ChartPanel(chart);
^
BarChart3DDemo2.java:67: cannot find symbol
symbol : class ChartPanel
location: class org.jfree.chart.demo.BarChart3DDemo2
final ChartPanel chartPanel = new ChartPanel(chart);
^
BarChart3DDemo2.java:82: cannot find symbol
symbol : class JFreeChart
location: class org.jfree.chart.demo.BarChart3DDemo2
final JFreeChart chart = ChartFactory.createBarChart3D(
^
BarChart3DDemo2.java:87: cannot find symbol
symbol : variable PlotOrientation
location: class org.jfree.chart.demo.BarChart3DDemo2
PlotOrientation.HORIZONTAL, // orientation
^
BarChart3DDemo2.java:82: cannot find symbol
symbol : variable ChartFactory
location: class org.jfree.chart.demo.BarChart3DDemo2
final JFreeChart chart = ChartFactory.createBarChart3D(
^
BarChart3DDemo2.java:93: cannot find symbol
symbol : class CategoryPlot
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryPlot plot = chart.getCategoryPlot();
^
BarChart3DDemo2.java:97: cannot find symbol
symbol : class CategoryAxis
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryAxis axis = plot.getDomainAxis();
^
BarChart3DDemo2.java:98: cannot find symbol
symbol : class CategoryLabelPositions
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryLabelPositions p = axis.getCategoryLabelPositions();
^
BarChart3DDemo2.java:100: cannot find symbol
symbol : class CategoryLabelPosition
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryLabelPosition left = new CategoryLabelPosition(
^
BarChart3DDemo2.java:100: cannot find symbol
symbol : class CategoryLabelPosition
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryLabelPosition left = new CategoryLabelPosition(
^
BarChart3DDemo2.java:101: cannot find symbol
symbol : variable RectangleAnchor
location: class org.jfree.chart.demo.BarChart3DDemo2
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
^
BarChart3DDemo2.java:101: cannot find symbol
symbol : variable TextBlockAnchor
location: class org.jfree.chart.demo.BarChart3DDemo2
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
^
BarChart3DDemo2.java:102: cannot find symbol
symbol : variable TextAnchor
location: class org.jfree.chart.demo.BarChart3DDemo2
TextAnchor.CENTER_LEFT, 0.0,
^
BarChart3DDemo2.java:103: cannot find symbol
symbol : variable CategoryLabelWidthType
location: class org.jfree.chart.demo.BarChart3DDemo2
CategoryLabelWidthType.RANGE, 0.30f
^
BarChart3DDemo2.java:105: cannot find symbol
symbol : variable CategoryLabelPositions
location: class org.jfree.chart.demo.BarChart3DDemo2
axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
^
BarChart3DDemo2.java:118: cannot find symbol
symbol : class PrintStreamLogTarget
location: class org.jfree.chart.demo.BarChart3DDemo2
Log.getInstance().addTarget(new PrintStreamLogTarget());
^
BarChart3DDemo2.java:118: cannot find symbol
symbol : variable Log
location: class org.jfree.chart.demo.BarChart3DDemo2
Log.getInstance().addTarget(new PrintStreamLogTarget());
^
BarChart3DDemo2.java:120: cannot find symbol
symbol : method pack()
location: class org.jfree.chart.demo.BarChart3DDemo2
demo.pack();
^
BarChart3DDemo2.java:121: cannot find symbol
symbol : variable RefineryUtilities
location: class org.jfree.chart.demo.BarChart3DDemo2
RefineryUtilities.centerFrameOnScreen(demo);
^
BarChart3DDemo2.java:122: cannot find symbol
symbol : method setVisible(boolean)
location: class org.jfree.chart.demo.BarChart3DDemo2
demo.setVisible(true);
^
44 errors -
hi all
please help how to save a movieclip in flash to svg...and how
to retrive the saved svg to movieclip in flash?
thanksDo you mean from flash in a web page or do you mean
converting the swf file format (maybe with a decompiler or
whatever).
If you're meaning to do it from flash in a web page:
You can't save a movieclip from flash to svg. You could
perhaps record drawingAPI commands and create the appropriate svg
output in an internal xml object which you then send to the server.
But I don't know of any pre-built classes to do that (disclaimer:
because I don't know of any doesn't mean they don't exist).
Going from svg to flash is doing it the other way around.
Converting the svg paths back to actionscript drawing commands. I
think I've seen some examples of this online somewhere.
Maybe you are looking for
-
Check/Validate Line item Amount against Credit Balance of Customer in FBL5N
Hi , I need to Check/Validate Line item Amount BSEG -WRBTR (Screen 301, Prg. SAPMF05A ) in F-02 against Credit Balance of Customer in FBL5N.If amount entered in F-02 with posting key 01 and same company code is greater than total credit balance with
-
Thumbnails wrong in Finder -- is there a way to refresh them?
When I edit a photo in Preview the small thumbnail changes to a generic jpg icon (in list and column view,) and the larger thumbnail (in icon view) remains that of the photo before it was edited. I can't figure out any way to refresh the thumbnail di
-
2010 i5 MBP USB Ports Not The Same? Griffin iMic Issue
I have a 2010 15" i5 MBP. I got one of the white iMics and it works fine on the port thats closest to the screen. However, when I plug it in to the port that's closer to the SD slot, it doesn't work. Under the audio settings screen, I see the iMic un
-
I have for some time experienced issues with the speed and quality using wlan with my Macbook Air. "normal" web browsing was normally fine but Skyping was almost impossible. I thought the problem was my network setup and my old netgear bridge using o
-
Billing to employee /sub dealers
Dear All, I have one scenario,basically client sells bread which is perishable food and dealers are like road side vendors who donot have shop/address/ Tin no etc..For them like milk ,news paper business,its business in the early morning. That is th