DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 7 of 7

Thread: Simple Help plz

  1. #1
    Join Date
    Sep 2005
    Posts
    8

    Red face Simple Help plz

    hi people
    im working on ATM class and i have a variable of type double named "amount"
    i can display it like this "System.out.print( amount );"
    but i want to display it using JOptionPane dialoge boxes.
    What is the line to use?

  2. #2
    Join Date
    Jan 2005
    Posts
    4
    I suggest you check out the Sun tutorials on Swing.

  3. #3
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    Code:
    java.text.DecimalFormat df=new java.text.DecimalFormat("0.00");
    JOptionPane.showMessageDialog(new Frame(),
                                      "Amount: "+df.format(amount),
                                      "Her it is",
                                      JOptionPane.INFORMATION_MESSAGE);
    eschew obfuscation

  4. #4
    Join Date
    Jun 2005
    Posts
    10
    try this,

    JOptionPane.showMessageDialog ( "Amount is " +amount);

  5. #5
    Join Date
    Sep 2005
    Posts
    8
    Thank you

  6. #6
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560

    Does this compile on 1.5 ?

    Quote Originally Posted by shivaprasad
    try this,

    JOptionPane.showMessageDialog ( "Amount is " +amount);
    It doesn't on 1.4...
    eschew obfuscation

  7. #7
    Join Date
    Jun 2005
    Posts
    10
    yeh it will work on 1.4

    i am using 1.4.2_07 version. it is working fine.

    bye
    shiva prasad.

Similar Threads

  1. plz plz plz help me(java)
    By kamon in forum Java
    Replies: 4
    Last Post: 08-10-2005, 10:30 AM
  2. java applet... i'm in a fix, plz help
    By nsbscool in forum Java
    Replies: 1
    Last Post: 05-02-2005, 08:01 AM
  3. Creating a Simple Combo Box in a Web App
    By Ranchoz71 in forum ASP.NET
    Replies: 3
    Last Post: 04-06-2005, 12:40 PM
  4. Simple VB 6.0 XML parsing
    By slimasian in forum VB Classic
    Replies: 1
    Last Post: 03-02-2005, 01:38 PM
  5. Simple Java DOM question
    By Lenin in forum XML
    Replies: 0
    Last Post: 03-21-2001, 04:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links