Anyone has a simple poll I can use or look at to give me an example of how

Anyone has a simple poll I can use or look at to give me an idea of how to do one? Something with radio button, and when a user chose a button it adds one to the total of that selection but minuses the other percentages of the other selection....something like that. And maybe using a graphical bar....hmmmm this looks hard already.

Something like this?import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
public class Test extends JFrame {
  JSlider[] js = new JSlider[5];
  int[] oldValues = new int[5];
  boolean isAdj=false;
  public Test() {
    JPanel content = (JPanel)getContentPane();
    content.setLayout(new BoxLayout(content, BoxLayout.X_AXIS));
    for (int x=0; x<js.length; x++) {
      js[x] = new JSlider(JSlider.VERTICAL,0,100,50);
      js[x].addChangeListener(new ChangeListener() {
     public void stateChanged(ChangeEvent ce) {
       if (!((JSlider)ce.getSource()).getValueIsAdjusting()) sliderSlid(ce);
      content.add(js[x]);
    this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
    addWindowListener(new WindowAdapter() {
      public void windowClosed(WindowEvent e) { System.exit(0); }
  private void sliderSlid(ChangeEvent ce) {
    if (isAdj) return;
    isAdj=true;
    int newTot=0;
    JSlider thisSlider = (JSlider)ce.getSource();
    int thisVal = thisSlider.getValue();
    System.out.println("TV="+thisVal);
    for (int x=0; x<js.length; x++) newTot+=js[x].getValue();
    System.out.println("NT="+newTot);
    double scale = (250.-thisVal)/(newTot-thisVal);
    System.out.println("SC="+scale);
    for (int x=0; x<js.length; x++) {
      if (js[x]!=thisSlider) js[x].setValue((int)(js[x].getValue()*scale));
    isAdj=false;
  public static void main(String[] args) {
    Test test = new Test();
    test.setSize(200,200);
    test.show();
}

Similar Messages

  • If anyone has a simple iPhone application for share ?

    if anyone has a simple iPhone application with teaching comments for share and he can post it here for the begginer developers, Thanks for help.

    Just search the web.  There are lots of tutorials for the beginner.  http://sptci.com/products/articles/iPhoneSDK.pdf had a very simple app creation tutorial at the end.  It should still work, althought that was created a few years ago.

  • Does anyone know of a product I can use to script over a Java Client for Or

    Does anyone know of a product I can use to script over a Java Client for Oracle Forms edition 9i??????????

    You should post your question in the Forms the Developer Suite forums. It is found at:
    Forms

  • Does anyone know what msn messenger you can use on ipad?

    Does anyone know what MSN Messenger you can use on a iPad?

    I'm used to Windows Live Messenger - but unlike with my former Blackberry - I'm not loving how it signs me offline if I want to do anything else with the iPhone.

  • We have been having some issues with Email notifications not going out and getting hung up in SOST.  Can anyone please tell me whether we can use Solution Manager to monitor outbound emails?

    We have been having some issues with Email Notifications not going out and getting hung up in SOST. Can anyone please tell me whether we can use SAP Solution Manager to monitor outbound email?

    What version of Solman are you using ?  Check in t-code Rz20 >ccms monitor template of satelliate system , there would be option to monitor your outbound mails .You can sutomise your monitorig metrics in solman 7.1  else in 7.01 you use auto reaction methods to monitor .
    Regards
    Jay

  • Can anyone recommend cloud storage that I can use with my AppleTV?

    I'm looking to get 2TB for my music and films can anyone recommend one that I can use with my AppleTV? Preferably with cloud too.

    Thanks Rudegar
    Apparently there is a way of doing it using the WD live book (which i know is not technoically cloud but that is what WD refer to it as). As you have said it can stream from iTunes, but if you store your movie file on your network drive and point iTunes at it, it will work. Apparently its easy, file / add file to library - then navigate to the folder location via the file path.
    I'll be trying this as soon as a test unit gets here and I'll update you.

  • Is anyone has already had the following error using PDF Generator?

    Hello,
    I try to convert some documents (.doc, .ppt, ...) into .pdf using the PDF Generator.
    And sometimes, I hava the following error in a .log file (in the out directory):
    Failed to process job DDLaunchObject-2006-08-08 13-22-40.102.doc
    Error Code: 1,011
    Reason: The BMC reported failure in converting the document.
    Is anyone has already had that error? What do I have to do?
    Please, could you help me?
    Thanks a lot!

    I have seen this error when trying to convert a certain Word document. The Word document itself when i opened it in Word resulted in a warning message that it needed to install a language pack, once i installed this language pack, the conversion in PDFG worked.
    PDFG uses the native process in the background to convert the files. That means for Word docs it actually uses msword.exe to read the document. If opening the document in Word results in any kind of error or user dialog, then this could be what causes the PDFG server to fail, as the server cannot respond to the error/dialog that occurs.
    hope that helps.
    David.

  • Can anyone recommend an app that I can use for business please?

    I'm a driving instructor and would love an app that I can use on the go to do my accounts. It would be great if it could link to my iCal as this is where I keep my appointments and lesson details. I use an iphone 3gs.

    Try looking here: http://appshopper.com/ipad/

  • Can someone give me an example on how to use keyevents with a textbox?

    I'm trying to have a method occur when the user hits the F2 button in a textbox. All the examples I've seen on this assume your using a menu and none seem descriptive for what I need. I'm also trying to find out how I can set my class to handle multiple event types. Ex.
    public class frmMain extends JFrame implements ActionListener
    how can I define this to handle multiple Listeners?
    How can I write it it to:
    A) Have a control respond to user input?
    B) Have it check to see if the key was pressed?
    I've used ActionListener events and I seem to have descriptions of that but I'm not sure how to tell if a key event was pressed. Ex.
    JButton cmdPushMe = new JButton("OK");
    cmdPushMe.addActionListener(this);
    public void actionPerformed(ActionEvent myEvent)
    Object eventSource = myEvent.getSource();
    if (eventSource==cmdPushMe)
    txtInput.setText("This works!");
    I have some code to test whether a key was pressed.
    if (eventSource==KeyStroke.getKeyStroke(KeyEvent.VK_F1))
    txtInput.setText("You pressed F1");
    I don't really know if this is how I should write it or what? Also since ActionListener only has one event (ActionPerformed) what is the
    default event for KeyListener being there are (keyPressed,keyReleased,keyTyped)? Is there a different way I should
    call this?

    You can use more than one listener:
    public class frmMain extends JFrame implements
    ActionListener, KeyListenerAnd don't forget to add the key listener to your textBox. Sounds stupid but you can easily forget and sometimes it takes a little while to realize thats why you key events are not fireing.

  • My Ipad 1 doesn't charge even after 5 hours of charging. I tried pressing the power and home button to reset it (even tried toggling the mute button a few times), but It doesn't start up with the apple logo. Anyone has any ideas what else can I try

    a have tried everyting now a dont have a clue what too do??

    Could be the charger, cable or iPad. Plug the USB cable into your computer. It may say "Not Charging", however, it is charging slowly and will verify that the cable is good. If your computer/iTunes does not recognize the iPad, then the cable is probably bad.
    Try this first -  Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W (5W on Mini) USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (2.5W, most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- %20beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    iPhone: Hardware troubleshooting (Power/Battery section also applies to iPad)
    http://support.apple.com/kb/TS2802
    The Ultimate Guide to Solving iOS Battery Drain
    http://www.overthought.org/blog/2014/the-ultimate-guide-to-solving-ios-battery-d rain
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    iOS 7 Battery Life Draining Too Fast? It’s Easy to Fix
    http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/
    Poor battery life after installing iOS 7.1? Try these simple tips
    http://www.zdnet.com/poor-battery-life-after-installing-ios-7-1-try-these-simple -tips-7000027348/
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    iPad: Charging the battery
    http://support.apple.com/kb/HT4060
    Charging Tip - Switching to airplane mode turns off battery-draining wireless and cellular access, allowing your iPhone/iPad to recharge up to twice as fast.
    Best Practices for iPad Battery Charging
    http://www.ilounge.com/index.php/articles/comments/best-practices-for-ipad-batte ry-charging/
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    To Extend a Device’s Battery Life, Get to Know It Better
    http://tinyurl.com/b67c7xz
    iPad Battery Replacement
    http://www.apple.com/batteries/replacements.html
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • How to tell if my netbook has gigabit Ethernet (and/or can use it)

    I have owned an Asus Eee 701SD (the 8GB version) since 2009, and installed Arch on it last summer (a great move :-) ).
    The other day, I came across a page on the FreeBSD wiki, which suggested that certain 700-series Eee's have a gigabit Ethernet interface (rather than the usual 10/100). Through checking 'hardinfo' and 'sudo lshw -c network', it appears that my machine might have a gigabit interface, but I'm not sure. This is the output from lshw:
    *-network
    description: Ethernet interface
    product: AR8121/AR8113/AR8114 Gigabit or Fast Ethernet
    vendor: Atheros Communications
    physical id: 0
    bus info: pci@0000:03:00.0
    logical name: eth0
    version: b0
    serial: 00:24:8c:3f:3a:ba
    capacity: 100Mbit/s
    width: 64 bits
    clock: 33MHz
    capabilities: pm msi pciexpress vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd autonegotiation
    configuration: autonegotiation=on broadcast=yes driver=ATL1E driverversion=1.0.0.7-NAPI firmware=L1e latency=0 link=no multicast=yes port=twisted pair
    resources: irq:44 memory:fbfc0000-fbffffff ioport:ec00(size=128)
    This is a bit confusing - the "capacity" heading above indicates the Ethernet is 10/100, but the Atheros Ethernet interface is given as "AR8121/AR8113/AR8114 Gigabit or Fast Ethernet" (confirmed by 'lspci'), which I guess means it can act as either gigabit or 10/100.
    Assuming that all this means I do have a gigabit Ethernet port on my netbook: will the Arch system make automatic use of the extra speed, or do I need to issue any commands, change any settings, recompile the kernel, etc.?
    Many thanks :-)
    Tim

    If it were a Gigabit NIC, it would simply be "AR8121/AR8113/AR8114 Gigabit"
    Seriously, if the driver is working properly, 100Mbit/s is what you have got.  You can check again with
    ethtool eth0
    which lists the supported device speeds.
    Last edited by lolilolicon (2012-01-12 11:21:30)

  • Is there a fast, simple email I can use with tiger? Yahoo takes a year to load, google a month!

    Please don't tell me to buy a new Mac....if I could, I would.

    Are you accessing your email through a web browser?  Switch to an email client. Try /applications/mail or download thunderbird.
    gmail.  configure your gmail account to send the data to your mail client. configure your mail client to receive email.
    yahoo. You will have to pay $20 to have your email forworded to you mail client.
    Try tenfourfox.
    We need more information.
    You may want to post machine info.
    blue apple > about this mac > more info button. Click on the hardware line. It has a little triangle in front of the word hardware.
    Leave out the serial number.
    Example:
    Machine Name: iMac
    Machine Model: PowerMac4,1
    CPU Type: PowerPC 750 (33.11)
    Number Of CPUs: 1
    CPU Speed: 600 MHz
    L2 Cache (per CPU): 256 KB
    Memory: 768 MB
    Bus Speed: 100 MHz
    Boot ROM Version: 4.1.9f1
    TenFourFox -- It's a port of the latest FireFox to run on older hardware and software.
    "World's most advanced web browser. Finely tuned for the Power PC."
        --  works for me on 10.4.  Supports 10.5
    http://www.floodgap.com/software/tenfourfox/
    alternative download site:
    http://www.macupdate.com/app/mac/37761/tenfourfox
    Turn on pipelining.  This will allow Firefox to make simaltaneous requests to the server.  Chrome has pipeling turned on. Some sites could fail to load with pipeling set on. The site will be old. See "Increase pipelining" in:
    http://www.hongkiat.com/blog/firefox-optimization-tips/
    OmniWeb uses the lastest Safari framework.  The open source WebKit. Other browsers like Safari and iCab use the OS version of WebKit.  The OmniWeb downloaded dmg includes it's own copy of the latest WebKit.
    http://www.omnigroup.com/products/omniweb/
    Safari 4.1.3 for Tiger
    http://support.apple.com/kb/DL1069

  • Very frequently when I click on a link, this message comes up: Connection was re-set. Then I can use Try again button. Annoying and time-waster. How to resolve this once and for all? In simple English only, please - I'm not a techie. Thanks.

    See question above. Think that says it.

    Maybe these will help:
    https://discussions.apple.com/message/17677533#17677533
    https://discussions.apple.com/message/18324129#18324129
    https://discussions.apple.com/message/18203126#18203126

  • My sites have been hacked and hostgator has told me to "Disable javascript - Use the firefox addon noscript" and I don't know how to. Are all updates always sent to me as that was another point made to prevent hackers? Thanks you. David. in English

    What are malicious scripts and what causes them? Over the years hackers found it hard to trick people into visiting suspicious sites so they're now targeting legit sites and using them to infect unknowing customers. In most cases an FTP account's password is obtained through key logging malware, then legit website files are modified to distribute the malware and gather more passwords. If your PC has been infected with one of these trojans, your bank account, email accounts, and FTP accounts may no longer be secure. * What to do if you find malicious scripts 1. Use the following online vulnerability scanner and ensure your software is up-to-date: http://secunia.com/vulnerability_scanning/online/?task=load 2. Download antivirus and fully scan your PC for malicious files. Here are some free online scanners: http://housecall.trendmicro.com/ http://www.bitdefender.com/scan8/ie.html http://www.kaspersky.com/virusscanner http://support.f-secure.com/enu/home/ols.shtml 3. Update all passwords that may have been obtained. Do not use old passwords, generate new ones. 4. Upload older versions of the files or contact support for assistance removing the malicious scripts. * Prevention - Ensure you use the latest browser version - Disable javascript - Use the firefox addon noscript - Download and install some free antivirus software, make sure it stays updated - Use http://www.avg.com.au/index.cfm?section=avg&action=onlinescan to test suspicious links you are given in emails or find online. If you are seeing a Google Attack Page when you visit the site, use the steps below to request that Google reindex the site and hopefully remove this block. This excerpt was copied from the URL below, and provides step by step instructions to request a delisting. http://www.google.com/support/webmasters/bin/answer.py?answer=45432 Once you have reviewed your site and are sure it is clean, you can can submit a request for review. Note that you'll need to verify site ownership before you can request a site review. 1. Sign in to Webmaster Tools with your Google account. 2. On the Dashboard, select the site you want. 3. On the Overview page, click Request a review and follow the instructions. Best regards, Tyler Evans Network Security Administrator HostGator.com LLC http://support.hostgator.com

    Thank you.
    I also had tried other means of getting answers and got an even more specific answer on just how to do this.  Below is the link to the actual knowledgebase article giving specific instructions since there are some files that need to be on the Palm and some on the card, etc.
    http://support.laridian.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=380&ratingconfirm=...
    I emailed Zondervan to see if they might be able to direct me to a downloadable manual.  The referred me to laridan.com who now supports their software.
    I followed the instructions, taking into account some things that were already where they needed to be, hot synced it and it seems to be working fine with 7.8 M free space on my Palm which I trust is enough for my other very large applications.
    Thanks for your help!
    Post relates to: Tungsten E2

  • I have an iPod touch and it's connected to my email account. Recently it has been frozen meaning I can't do anything on it (read emails, delete emails). How do I fix this problem?

    Does anyone know how to fix my problem so I can do stuff with my email?
    Thank you so much

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.

Maybe you are looking for