Java menus, noob needs lotsa help

how do u create menus, i have seen books and stuff, but they don't help. i need to know how to open from a file with the open box popping up. like, how do u save to a file, open from a file, etc. all the books say is that u can create a menu and u need an actionlistener. plz help, i hope i am not confusing

how do u create menus, i have seen books and stuff,
but they don't help. i need to know how to open from
a file with the open box popping up. like, how do u
save to a file, open from a file, etc. all the books
say is that u can create a menu and u need an
actionlistener. plz help, i hope i am not confusingThere are five basic steps you'll need to do.
Step 1. Create an AbstractAction
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
AbstractAction openAction = new AbstractAction("Open File...") {
public void actionPerformed(ActionEvent e) {
JFileChooser myChooser = new JFileChooser( );
// <YOUR_COMPONENT> is the containing Component, like the JDialog.
myChooser.showDialog(<YOUR_COMPONENT>, "Open File...");
Step 2. Create a JMenuItem and attach your newly created AbstractAction.
import javax.swing.JMenuItem;
JMenuItem myMenuItem = new JMenuItem(openAction);
Step 3. Add the JMenuItem you just created to your JMenu
import javax.swing.JMenu;
JMenu myFileMenu = new JMenu("File");
myFileMenu.add(myMenuItem);
Step 4. Add the JMenu you just created to a JMenuBar
import javax.swing.JMenuBar;
JMenuBar myMenuBar = new JMenuBar( );
myMenuBar.add(myFileMenu);
Step 5. Set the menu bar of your parent JDialog or JFrame to the JMenuBar you just created is Step 4.
import javax.swing.JDialog;
JDialog mainDialog = new JDialog( );
mainDialog.setJMenuBar(myMenuBar);

Similar Messages

  • Java Student In Need Of Help - JDBC

    I need to create a connection between a MS Access database and my Java Application. Could anyone help me with this? I've tried the online tutorials but I still could not manage to get my head around it!
    Please help
    Finbarr.

    hey lee
    i'm just after finding a good site on JDBC with MS ACCESS, so i'm going to study this and see can i make head or tails of it! i really want to try and see if i can do it myself first. If i'm having trouble I'll get back to ya!
    This is my first time in here!
    Thanx
    Fin.

  • At a dead end.  A java student in need of help.

    I've hit a wall.
    The program is supposed to allow the user to draw five different polygons using the polygon class and let the user pick the color for each polygon and move each polygon around the screen once it is filled in. The user clicks to add the points and then double clicks to fill in the polygon. Then the polygon is added to the array. Up to the dragging around the screen the program works fine. When I click on a polygon with the shift down nothing happens and I've spent several hours trying to figure out why.
    I've placed several System.out.println's in the code and I think I've narrowed down the problem. (I hope) I think it might have something to do with the canvas repainting. Because the S.O.P's show that the program is going through and executing that code. It might also have something to the do with my polygon array, but to my knowledge that is setup fine.
    Thanks a bunch if you try to help.
    Brad
    // Full Code Below
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class poly extends JFrame implements ActionListener
         /* Accessible Variables */
         private JPanel canvas;
         private JPanel mp;
         private JComboBox choice;
         private JButton reset;
         private Podly polyArray[] = new Podly[5];
         private Podly currentPoly = new Podly();
         private Podly movingPoly = new Podly();
         private int count;
         private Color currentColor;
         private Point firstPoint;
         private boolean newPoly = true;
         private boolean moving = false;
         private boolean overflowed = false;
         poly()
              setTitle("Polygon");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              count = 0;
              /* Interactive Buttons and Menus */
              JMenuBar tp = new JMenuBar();
              JMenu color = new JMenu("Color");
              JMenuItem MBlack = new JMenuItem("Black");
              color.add(MBlack);
              JMenuItem MRed = new JMenuItem("Red");
              color.add(MRed);
              JMenuItem MGreen = new JMenuItem("Green");
              color.add(MGreen);
              JMenuItem MYellow = new JMenuItem("Yellow");
              color.add(MYellow);
              MBlack.addActionListener(this);
              MRed.addActionListener(this);
              MGreen.addActionListener(this);
              MYellow.addActionListener(this);
              tp.add(color);
              canvas = new CanvasArt();
              canvas.setBackground(Color.white);
              canvas.addMouseListener(new Points());
              canvas.addMouseMotionListener(new Moved());
              choice = new JComboBox();
              choice.addItem("Black");
              choice.addItem("Red");
              choice.addItem("Green");
              choice.addItem("Yellow");
              choice.addActionListener(this);
              reset = new JButton("Reset");
              reset.addActionListener(this);
              JLabel chooseColor = new JLabel("Choose a color:");
              JLabel holdShift = new JLabel("Hold shift, click, and drag to move a polygon.");
              mp = new JPanel();
              mp.add(chooseColor);
              mp.add(choice);
              mp.add(reset);
              mp.add(holdShift);
              setJMenuBar(tp);
              getContentPane().add(canvas);
              getContentPane().add(mp, "South");          
         public static void main(String [] args)
              JFrame main = new poly();
              main.setSize(600, 600);
              main.setVisible(true);
         public void actionPerformed(ActionEvent e)
              Object test = e.getSource();
              Object selection;
              if (test instanceof JComboBox)
                   JComboBox source = (JComboBox)e.getSource();
                   selection = source.getSelectedItem();
                   if (selection.equals("Black")) currentColor = Color.black;
                   else if (selection.equals("Red")) currentColor = Color.red;
                   else if (selection.equals("Green")) currentColor = Color.green;
                   else if (selection.equals("Yellow")) currentColor = Color.yellow;
              else if (test instanceof JButton) // Repaints if Reset Button is Pressed
                   repaint();
                   currentPoly.reset();
                   count = 0;
                   overflowed = false;
              else
                   JMenuItem source = (JMenuItem)e.getSource();
                   selection = source.getText();
                   if (selection.equals("Black")) currentColor = Color.black;
                   else if (selection.equals("Red")) currentColor = Color.red;
                   else if (selection.equals("Green")) currentColor = Color.green;
                   else if (selection.equals("Yellow")) currentColor = Color.yellow;
         class Podly extends Polygon // Class adds Color Fuctionality to Polygon class
              Color polyColor;
              void setColor(Color y)
              {polyColor = y;}
              Color getColor()
              {return polyColor;}
         /* Canvas Painting Panel */
         class CanvasArt extends JPanel
              public void paintComponent(Graphics g)
                   super.paintComponent(g);
                   System.out.println("Canvas is called");
                   System.out.println(polyArray);
                   for (int i=0; i>count;i++)
                        System.out.println("Loop is going");
                        Podly y = polyArray;
                        g.setColor(y.getColor());
                        g.fillPolygon(y);
                        System.out.println(y);
                        System.out.println("Loop has filled in polygon"); // Test
                   System.out.println("painting complete");
         class Points extends MouseAdapter
              public void mousePressed(MouseEvent e)
                   Graphics g = canvas.getGraphics();
                   if (overflowed) // Checks for overflow in program.
                        g.setColor(Color.RED);
                        Font font = new Font("SansSerif",Font.BOLD, 30);
                        g.setFont(font);
                        g.drawString("OVERFLOW", 10, 30);
                        Font font2 = new Font("SansSerif",Font.BOLD, 20);
                        g.setFont(font2);
                        g.setColor(Color.BLUE);
                        g.drawString("Double Click to Play Again", 10, 50);
                        if (e.getClickCount() == 2) // Allows user to play again.
                             repaint();
                             currentPoly.reset();
                             count = 0;
                             overflowed = false;
                   else
                        int x = e.getX();
                        int y = e.getY();
                        if (newPoly)
                             firstPoint = new Point(x,y);
                             if (e.isShiftDown())
                                  System.out.println("Gets before Check loop");
                                  for (int r=count-1;r>=0;r--)
                                       System.out.println("Inside For Check Loop");
                                       System.out.println(polyArray[r]);
                                       if (!polyArray[r].contains(x,y))          
                                            System.out.println("Point is found");
                                            movingPoly = polyArray[r];
                                            System.out.println("MovingPoly Defined");
                                            moving = true;
                                            System.out.println("Moving is true"); // test
                                            break;
                             else
                                  currentPoly.setColor(currentColor);
                                  currentPoly.addPoint(x,y);
                                  g.fillOval(x,y,1,1);
                                  newPoly = false;
                        else
                             if (e.getClickCount() == 2)
                                  g.setColor(currentPoly.getColor());
                                  g.fillPolygon(currentPoly);
                                  polyArray[count] = currentPoly;
                                  currentPoly.reset();
                                  count++;
                                  if (count == polyArray.length)
                                  {overflowed = true;}
                                  newPoly = true;
                             else
                                  g.setColor(currentPoly.getColor());
                                  currentPoly.addPoint(x,y);
                                  g.drawLine(firstPoint.x, firstPoint.y, x, y);
                                  firstPoint.move(x,y);
              public void mouseReleased(MouseEvent e)
                   if(e.isShiftDown())
                   { moving = false; }
         class Moved extends MouseMotionAdapter
              public void mouseDragged(MouseEvent e)
                   if (moving && e.isShiftDown())
                        int x = e.getX();
                        int y = e.getY();
                        System.out.println("Gets here");
                        movingPoly.translate((x-firstPoint.x),(y-firstPoint.y));
                        firstPoint.move(x,y);
                        canvas.repaint();

    Here is the updated code still with the color error I talked about above.
    :) Thanks for all the help everyone.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class poly extends JFrame implements ActionListener
         /* Accessible Variables */
         private JPanel canvas;
         private JPanel mp;
         private JComboBox choice;
         Podly [] polyArray;
         private Podly currentPoly;
         private Podly movingPoly;
         private int count;
         private Color currentColor;
         private Point firstPoint;
         private Color polyColor;
         private boolean newPoly = true;
         private boolean moving = false;
         private boolean overflowed = false;
         poly()
              setTitle("Polygon");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  // Exits program on window close.
              polyArray = new Podly[5];
              count = 0;                                      // Set count to zero.
              /* Interactive Buttons and Menus */
              JMenuBar tp = new JMenuBar();
              JMenu color = new JMenu("Color");
              JMenuItem MBlack = new JMenuItem("Black");
              color.add(MBlack);
              JMenuItem MRed = new JMenuItem("Red");
              color.add(MRed);
              JMenuItem MGreen = new JMenuItem("Green");
              color.add(MGreen);
              JMenuItem MYellow = new JMenuItem("Yellow");
              color.add(MYellow);
              MBlack.addActionListener(this);
              MRed.addActionListener(this);
              MGreen.addActionListener(this);
              MYellow.addActionListener(this);
              tp.add(color);
              canvas = new CanvasArt();
              canvas.setBackground(Color.white);
              canvas.addMouseListener(new Points());
              canvas.addMouseMotionListener(new Moved());
              choice = new JComboBox();
              choice.addItem("Black");
              choice.addItem("Red");
              choice.addItem("Green");
              choice.addItem("Yellow");
              choice.addActionListener(this);
              JLabel chooseColor = new JLabel("Choose a color:");
              JLabel holdShift = new JLabel("Hold shift, click, and drag to move a polygon.");
              mp = new JPanel();
              mp.add(chooseColor);
              mp.add(choice);
              mp.add(holdShift);
              setJMenuBar(tp);
              getContentPane().add(canvas);
              getContentPane().add(mp, "South");          
         /* Button Listeners */
         public void actionPerformed(ActionEvent e)
              Object test = e.getSource();
              Object selection;
              if (test instanceof JComboBox)
                   JComboBox source = (JComboBox)e.getSource();
                   selection = source.getSelectedItem();
                   if (selection.equals("Black")) currentColor = Color.black;
                   else if (selection.equals("Red")) currentColor = Color.red;
                   else if (selection.equals("Green")) currentColor = Color.green;
                   else if (selection.equals("Yellow")) currentColor = Color.yellow;
              else
                   JMenuItem source = (JMenuItem)e.getSource();
                   selection = source.getText();
                   if (selection.equals("Black")) currentColor = Color.black;
                   else if (selection.equals("Red")) currentColor = Color.red;
                   else if (selection.equals("Green")) currentColor = Color.green;
                   else if (selection.equals("Yellow")) currentColor = Color.yellow;
         class Podly extends Polygon  // Class adds Color Fuctionality to Polygon class
              void setColor(Color y)  // sets the Polygon's color.
              {polyColor = y;}
              Color getColor()   // returns the Polygon's color.
              {return polyColor;}
         /* Canvas Painting Panel */
         class CanvasArt extends JPanel
              public void paintComponent(Graphics g)
                   super.paintComponent(g);
                        for (int i=0; i<count;i++)
                             g.setColor(polyArray.getColor());
                             g.fillPolygon(polyArray[i]);
         class Points extends MouseAdapter
              /* Listens for mouse press, constructs polygons, stores them in array. */
              public void mousePressed(MouseEvent e)
                   Graphics g = canvas.getGraphics();
                   if (overflowed) // Checks for overflow in program.
                        g.setColor(Color.RED);
                        Font font = new Font("SansSerif",Font.BOLD, 30);
                        g.setFont(font);
                        g.drawString("OVERFLOW", 10, 30);
                        Font font2 = new Font("SansSerif",Font.BOLD, 20);
                        g.setFont(font2);
                        g.setColor(Color.BLUE);
                        g.drawString("Double Click to Play Again", 10, 50);
                        if (e.getClickCount() == 2) // allows user to play again by resetting.
                             repaint();
                             count = 0;
                             overflowed = false;
                   else
                        int x = e.getX();
                        int y = e.getY();
                        if (newPoly)
                             firstPoint = new Point(x,y);
                             if (e.isShiftDown())
                                  for (int r=count-1;r>=0;r--)
                                       if (polyArray[r].contains(x,y))          
                                            movingPoly = polyArray[r];
                                            moving = true;
                                            break; // exits for loop after Polygon with point is found.
                             else
                                  currentPoly = new Podly();
                                  currentPoly.addPoint(x,y); // Adds the first point.
                                  currentPoly.setColor(currentColor); // Sets the Polygon Color
                                  g.fillOval(x,y,1,1);
                                  newPoly = false;
                        else
                             /* Close the current Polygon at double click,
                             * then moves on to the next. */
                             if (e.getClickCount() == 2)
                                  g.setColor(currentPoly.getColor());
                                  g.fillPolygon(currentPoly);
                                  polyArray[count] = currentPoly;
                                  count++;
                                  if (count == polyArray.length)
                                  {overflowed = true; canvas.repaint();}
                                  newPoly = true;
                             else
                                  g.setColor(currentPoly.getColor());
                                  currentPoly.addPoint(x,y);
                                  g.drawLine(firstPoint.x, firstPoint.y, x, y);
                                  firstPoint.move(x,y);
              /* Listens for mouse release */
              public void mouseReleased(MouseEvent e)
                   if(e.isShiftDown())
                   { moving = false; }
         /* Moves selected Polygon around */
         class Moved extends MouseMotionAdapter
              public void mouseDragged(MouseEvent e)
                   if (moving && e.isShiftDown())
                        int x = e.getX();
                        int y = e.getY();
                        movingPoly.translate((x-firstPoint.x),(y-firstPoint.y));
                        firstPoint.move(x,y);
                        canvas.repaint();
         public static void main(String [] args)
              JFrame poly = new poly();
              poly.setSize(600, 600);
              poly.setVisible(true);

  • Mac noob needs monitor help! how do I...

    I was given a 2003 imac as a gift. I've always had PCs but was thrilled to have my first mac to play around with. The bad news is that about half the time the monitor doesn't work!!! I turn the computer on and the screen comes on for a split second and then just turns black. The computer is working just fine, in fact if I hold a bright light up to the monitor at just the right angle I can see the screen and see that everything is working...except the monitor. If I put the computer on sleep mode and then touch the keyboard of move the mouse the monitor will work again, but just for one second before going black. The other half of the time the computer works just fine.
    SO....seeing as how I am not a rich man I was hoping that there was a way to use my TV as a monitor. I know how to do it was my PC but I am totally clueless with macs. Can it be done? What kind of cable would I have to buy?
    Any and all help is appreciated.

    A 2003 iMac would be the type that has the display on a chrome-plated arm that swivels and moves up and down, like this one?
    http://www.everymac.com/systems/apple/imac/stats/imac700fp.html
    If so, you should try this procedure to reset the PMU (power management).
    http://support.apple.com/kb/HT1712
    See if that makes the video issue, which sounds like a back-light problem, go away.
    It has a mini-VGA port for video output. It mirror the built in display at up to 1024x768.
    You need an adapter like this
    [Apple Mini-VGA to TV Analog Output|http://cgi.ebay.com/Apple-Mini-VGA-to-TV-Analog-Output-Cable-Mac-AdapterW0QQitemZ310140585854QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item4835d1c77e&_ trksid=p3286.c0.m14&trkparms=72%3A1205%7C66%3A2%7C65%3A12%7C39%3A1%7C240%3A1318%7C301%3A1%7C293%3A1% 7C294%3A50]
    to connect it to a TV. If you have an old VGA CRT display, it would produce better results for use as a computer. Then you need a mini-VGA adapter that goes to VGA, which I believe is this one
    [Apple mini-VGA to VGA adapter|http://cgi.ebay.com/Apple-Mac-Powerbook-mini-VGA-to-VGA-converter-adapt orW0QQitemZ120427739120QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item1c0a0d77f0&_ trksid=p3286.c0.m14&trkparms=72%3A1205%7C66%3A2%7C65%3A12%7C39%3A1%7C240%3A1318%7C301%3A1%7C293%3A1% 7C294%3A50]
    (I don't know anything about these eBay sellers.)

  • A new Java Student in need of help

    I am new to this Java language and while so far I have found it to be quite easy I have now come up against a program that is giving me some problems. Our teacher has given us this program that had a bunch of errors and we had to find them and also correct them. There were 20 errors to start and I have gotten it down to only 2 errors but I cannot figure out how to correct them. The teacher said to use whatever we could get our hands on to help us correct this code (internet, books, etc) so I figured that I would try this message board. This is my first post so could someone please give me a hand? Here is the code:
    import java.util.*;
    public class Names
    public static void main(String args)
    try
    List list = createList(args);
    Collections.sort(list);
    Iterator i = list.iterator();
    while (i.hasNext())
    String s = (String) i.next();
    system.out.println(s);
    catch (Exception e)
    System.out.printlnn("Exception"+ e.getMessage() "\n");
    private static List createList(String args[]) throws Exception
    List List;
    if (args.length == 0 || argx(0).equals("ArrayList"))
    list = ArrayList();
    System.out.println("Using ArrayList");
    else if (args[0].equals("LinkedList"))
    list = new LinkedList();
    system.out.println("Using LinkedList");
    else if
    throw new Exception
    ("invalid argument " + args[0] + ". Valid choices are ArrayList or LinkedList");
    fillList(list);
    return list;
    private static void fillList (List list)
    list.add("Jim");
    list.add("Helen");
    list.add("Jennifer");
    list.add("Daniel");
    list.add("Michelle");
    and here are the 2 errors that I can't seem to figure out:
    C:\$jg105\Names.java:24: ')' expected.
    System.out.printlnn("Exception"+ e.getMessage() "\n");
    ^
    C:\$jg105\Names.java:41: '(' expected.
    else if
    ^
    2 errors
    Finished
    any help will be appreciated thanks Bob

    import java.util.*;
    //add this:
    import java.util.LinkedList;
    public class Names
    //CHANGE    public static void main(String args) {
        public static void main(String[] args) {
            try {
                List list = createList(args);
                Collections.sort(list);
                Iterator i = list.iterator();
                while ( i.hasNext() ) {
                    String s = (String) i.next();
    // CHANGE               system.out.println(s);
                    System.out.println(s);
            catch (Exception e) {
    // CHANGE           System.out.printlnn("Exception"+ e.getMessage() "\n");
            System.out.println("Exception"+ e.getMessage()+"\n");
        private static List createList(String args[]) throws Exception {
    // CHANGE       List List;
            List list;
    // CHANGE       if ( args.length == 0 || argx(0).equals("ArrayList") ) {
            if ( args.length == 0 || args[0].equals("ArrayList") ) {
    // CHANGE           list = ArrayList();
                list = new ArrayList();
                System.out.println("Using ArrayList");
            } else if ( args[0].equals("LinkedList") ) {
                list = new LinkedList();
    // CHANGE           system.out.println("Using LinkedList");
                System.out.println("Using LinkedList");
    // CHANGE       } else if {
                } else {
                throw new Exception
                    ("invalid argument " + args[0] + ". Valid choices are ArrayList or LinkedList");
            fillList(list);
            return list;
        private static void fillList (List list) {
            list.add("Jim");
            list.add("Helen");
            list.add("Jennifer");
            list.add("Daniel");
            list.add("Michelle");
    }

  • How do i edit this pdf file? Noob needs pro help

    I have to translate this pdf file to spanish. i tryed the following " advanced edition -> edit text" didn't work... maybe they scanned the file? tryed: "document -> ocr text recognition"... didn't work either.
    I have Adobe Acrobat Professional. i attached one page of thefile i want to edit. Please help me!!!

    Have you tried the TOOLS>Advanced Editing>Touchup Text Tool? You will have to have the fonts on your system to do the edit. You might be able to change the font to something else on your system if needed. The file is all text (in boxes) and the touchup text tool should do the job. I was able to change the fonts to Arial (not all of them, there are a few that are still in the old font that are numbers). I have posted the result at http://wadavis.ece.vt.edu/CO2 ophir lenses.pdf. (you may have to replace the spaces with %20)

  • Z77A-GD65 with 3570k noobie needs some help.

    Hi Guys,
    First of all I’m very impressed by the looks of GD65, I just hope it will work as well as it looks… 
    So finally I should get my RAM tonight (4 x 4gb Sammy ECO ram).   I believe there might some issues with o/c the memory, which I believe was a ittle improved in beta bios.
    3570k
    Silver Arrow SB-E HSF
    4 x 4gb Sammy eco ram
    Gigabyte gtx670 GPU should arrive early next week.
    Corsair TX750
    Windows 7 x64 SP1 Home
    HAF 922 case
    I’ll use this method to upgrade mobo to the latest official BIOS 10.5 using recommeded method.
    https://forum-en.msi.com/index.php?topic=108079.0
    Also should I wait for Gtx670 to come in next week, or would I be able to use hdmi/dvi output from GD65 (IB HD4000 IGPU) to display 1080P on LG 32LD450 display.  I believe there were some reports only VGA output works? Is it true?   
    Also where should I get most stable NIC Intel drivers (I saw some people having problems with them) and 898 audio drivers?
    Is official 10.5 BIOS recommend or is there a “better” beta BIOS I should install (and where do I get it from)?
    I do apologize for so many questions, but I’m very scared to put this rig together with so many z77 chipset issues around…   I’m just trying to avoid “ I told you so” from my wife… LOL  I’m concern about error 55 (memory not installed), in some cases CPU installation issues.  I’m coming from several years of AMD builds… so IB it is very new to me…
    Any help would be much appreciated… 
    TIA

    I promise as soon as I get everything stable I will test it with 200mm fan as intake and outtake...
    I love big sinks and fans, I will post some pictures after everything is done.  My system is nothing to brag about, HAF 922 with  3 x 200mm  1 x 120mm, 1 x 140mm and Silver Arrow SB-E (dual tower) HSF.    I’m using Lampron fan controller to control fans.
    Positive pressure is very interesting concept and some swear it works...
    http://www.silverstonetek.com/techtalk_cont.php?tid=wh_positive&area=usa
    So I went to bed at 3am last night, I did go far, as I was taking updates, installing drivers, changing drive letters… etc..   
    System seems to be stable at stock/default 10.3  bios settings, all I changed was to set fans on CPU (I selected 70C to be my goal) and SYSFAN1 to run at 50% (my 140mm internal fan, which is strapped to the drive cage).   
    The NIC card seems to be working fine,  Intel IGPU video works fine (using dvi to hdmi cable). I haven’t installed any temp monitoring software so I cannot tell you how is my IB CPU. 
    The only problem I found last night was I couldn’t get any audio from rear speaker output (I tried display’s and 2.1 speakers).   The driver seems to be working, because I can see sound bar moving up and down.  Also when I connect my headphone to my front audio output, I can hear sound and I get pop up saying I have headphones connected.    When I remove headphones I get another pop up saying the headphones have been disconnected.  When I connect anything to the green output (speaker out), I get pop up saying rear speakers were detected, however there is nothing no static, noise or anything…     I tried to disable/enable device without luck.      I’ve used all drivers from MSI website, should I try to see if there are newer/older drivers?   Since I’m currently using 10.3 BIOS, should I try latest 10.5?      Have you guys heard about this problem before?      If you have any ideas please let me… I did poke around BIOS but I couldn’t find anything related to audio…   
    Overall (other than small audio hiccup) “so far” I’m very happy from my purchase… 
    Thank you

  • I'm new here, I need lotsa help and I found no toturial about JavaMail

    Hi there, people!
    I'm starting to use JavaMail just now and I don't know ANYTHING about it.
    For start, I need a program that looks inside a database and if a order was flagged as DONE I need it to send a mail to the client telling him it. All the logic part to do it is ok, but I still need to send the client (or clients) the mail. How do I do it? Do I really need JavaMail API? What SMTP server shoud I use (Yahoo?)??
    The thing is: I haven't found a TUTORIAL about it. If any of you can't answer the questions I just put in here, maybe you could tell me one place I can find a tutorial about it.
    Thanks in advance!

    And as to what SMTP server you should use: You should use one you are authorized to use. That will generally exclude public servers like Yahoo and Hotmail. If you are doing this for a company then that company would usually have its own SMTP server, which is the one you should use. If you are doing it for personal use then perhaps your ISP (Internet Service Provider, the people you pay to connect you to the Internet) allows you to use theirs. Ask them.
    PC&#178;

  • I wish to teach Java, but may need some help

    Hi,
    I teach Junior High, and since no formal programming class exists, I have made a programming club. We have spent the last while doing some mindless tech work, but now I want to get them bitting their teeth on Java. I taught it a few years ago, so the code doesn't worry me a bit. Its more the initial setup and I'm open to ideas.
    Primarily, each computer connects to the host with a private directory (h: drive) and a public (s: drive)
    While I'm reluctant to load java on 30 machines (as the club handles 4-8 at a time) is there a way to install Java on the public drive and allow students to access it from time to time?
    Is there a smaller version of java that might be better? We will not be using any various libraries, focusing more on input and output and really simple programs...
    I also noticed that notepad is attaching .txt to our java files. I'm just going to have to get used to the students renaming their files before compiling...
    any advice on the setup and teaching will be great!
    thx

    hi
    i am s tudent myself and i will tell u what they r doin in out college lab
    we have around 200 systems in the lab and they have installed java on only the server. The folder in the server is mapped on to each system as it boots. Indeed this makes the process of logging in slow...but it eliminates implementation of java on each machine. most students do have a copy of the compiler in our logins for better usage.
    as for using notepad, i would suggest other java ide rather than notepad....jcreator is the best i have seen so far...editplus is also good(its so small not even 1mb)
    the above products are license free for trial usage and cost a little for registration...
    actually jcreatorLE is completely free...try using it...
    all the best in ur endeavour...
    cheers
    rizi

  • Noob need experts' help!!

    Hi,
    I am trying to create a web page with a flash movies. The
    user click on the movie and it will bring you to another page. How
    do you create a hyperlink for a flash movie in asp.net? I have
    download the flash control for asp.net. However it doesn't allow me
    to hyper link the flash movie.

    Thank You Noel!
    If could help someone, I've found a great tutorial about this, of course you can take more saturation:
    http://www.youtube.com/watch?v=YdaqW2yFDj8
    This youtuber is really fantastic!

  • Complete Java n00b...need some help

    I'm very new to Java and I need some help writing a basic program.
    I need to write a program that lets the user add up an infinite amount of floating point numbers. The program should compute the sum of all the numbers entered thus far. So for example if the user enters 2 and 3, it should give a number of 5. If the user then enters 4, I should give me 9 etc.
    I'm not really sure how to get started on writing that. I can add up two numbers but I don't know how to tell the program to keep adding additional numbers to that sum. Can someone please help me out? thanks

    It's ok... it can be hard to understand even the simplest concepts with only text and no help.
    There needs to be an int variable outside (before) the loop initialized to 0.
    float num = 0;Next, you need to have an infinite loop that requests floats to add onto the number.
    Scanner input = new Scanner(System.in);
    while (true) {
        float toAdd = input.nextFloat();
        num += toAdd;
        System.out.println("Current sum " + num);
    }Putting all this together and putting it into a main method will work, but we have a bit of an issue. The program won't stop! For that reason, we need to specify a number which can exit the program. I like to use 0 for this purpose.
    Scanner input = new Scanner(System.in);
    while (true) {
        float toAdd = input.nextFloat();
        if (toAdd == 0) {    //test if toAdd is 0 so the program can break;
            break;
        num += toAdd;
        System.out.println("Current sum " + num);
    }So, this code will work:
    import java.util.Scanner;
    class AddNumbers {
        public static void main(String[] args) {
            float num = 0;
            Scanner input = new Scanner(System.in);
            while (true) {
                float toAdd = input.nextFloat();
                if (toAdd == 0) {    //test if toAdd is 0 so the program can break;
                    break;
                num += toAdd;
                System.out.println("Current sum: " + num);
    }Edited by: Arricherekk on May 18, 2008 3:19 PM

  • Need some help with a program Please.

    Well, im new here, im new to java, so i need your help, i have to make a connect four program, my brother "Kind of" helped me and did a program for me, but the problem is i cant use some of those commands in the program and i have to replace them with what ive learned, so i will post the program and i will need your help to modify it for me.
    and for these programs, also i want help for:
    They have errors and i cant fix'em
    the commands that i've leaned:
    If statements, for loops, while loops,do while, strings, math classes, swithc statement, else if,logical operators,methods, one and two dimensional arrays.
    Thanx in advance,
    truegunner
    // Fhourstones 3.0 Board Logic
    // Copyright 2000-2004 John Tromp
    import java.io.*;
    class Connect4 {
    static long color[]; // black and white bitboard
    static final int WIDTH = 7;
    static final int HEIGHT = 6;
    // bitmask corresponds to board as follows in 7x6 case:
    // . . . . . . . TOP
    // 5 12 19 26 33 40 47
    // 4 11 18 25 32 39 46
    // 3 10 17 24 31 38 45
    // 2 9 16 23 30 37 44
    // 1 8 15 22 29 36 43
    // 0 7 14 21 28 35 42 BOTTOM
    static final int H1 = HEIGHT+1;
    static final int H2 = HEIGHT+2;
    static final int SIZE = HEIGHT*WIDTH;
    static final int SIZE1 = H1*WIDTH;
    static final long ALL1 = (1L<<SIZE1)-1L; // assumes SIZE1 < 63
    static final int COL1 = (1<<H1)-1;
    static final long BOTTOM = ALL1 / COL1; // has bits i*H1 set
    static final long TOP = BOTTOM << HEIGHT;
    int moves[],nplies;
    byte height[]; // holds bit index of lowest free square
    public Connect4()
    color = new long[2];
    height = new byte[WIDTH];
    moves = new int[SIZE];
    reset();
    void reset()
    nplies = 0;
    color[0] = color[1] = 0L;
    for (int i=0; i<WIDTH; i++)
    height[i] = (byte)(H1*i);
    public long positioncode()
    return 2*color[0] + color[1] + BOTTOM;
    // color[0] + color[1] + BOTTOM forms bitmap of heights
    // so that positioncode() is a complete board encoding
    public String toString()
    StringBuffer buf = new StringBuffer();
    for (int i=0; i<nplies; i++)
    buf.append(1+moves);
    buf.append("\n");
    for (int w=0; w<WIDTH; w++)
    buf.append(" "+(w+1));
    buf.append("\n");
    for (int h=HEIGHT-1; h>=0; h--) {
    for (int w=h; w<SIZE1; w+=H1) {
    long mask = 1L<<w;
    buf.append((color[0]&mask)!= 0 ? " @" :
    (color[1]&mask)!= 0 ? " 0" : " .");
    buf.append("\n");
    if (haswon(color[0]))
    buf.append("@ won\n");
    if (haswon(color[1]))
    buf.append("O won\n");
    return buf.toString();
    // return whether columns col has room
    final boolean isplayable(int col)
    return islegal(color[nplies&1] | (1L << height[col]));
    // return whether newboard lacks overflowing column
    final boolean islegal(long newboard)
    return (newboard & TOP) == 0;
    // return whether newboard is legal and includes a win
    final boolean islegalhaswon(long newboard)
    return islegal(newboard) && haswon(newboard);
    // return whether newboard includes a win
    final boolean haswon(long newboard)
    long y = newboard & (newboard>>HEIGHT);
    if ((y & (y >> 2*HEIGHT)) != 0) // check diagonal \
    return true;
    y = newboard & (newboard>>H1);
    if ((y & (y >> 2*H1)) != 0) // check horizontal -
    return true;
    y = newboard & (newboard>>H2); // check diagonal /
    if ((y & (y >> 2*H2)) != 0)
    return true;
    y = newboard & (newboard>>1); // check vertical |
    return (y & (y >> 2)) != 0;
    void backmove()
    int n;
    n = moves[--nplies];
    color[nplies&1] ^= 1L<<--height[n];
    void makemove(int n)
    color[nplies&1] ^= 1L<<height[n]++;
    moves[nplies++] = n;
    public static void main(String argv[])
    Connect4 c4;
    String line;
    int col=0, i, result;
    long nodes, msecs;
    c4 = new Connect4();
    c4.reset();
    BufferedReader dis = new BufferedReader(new InputStreamReader(System.in));
    for (;;) {
    System.out.println("position " + c4.positioncode() + " after moves " + c4 + "enter move(s):");
    try {
    line = dis.readLine();
    } catch (IOException e) {
    System.out.println(e);
    System.exit(0);
    return;
    if (line == null)
    break;
    for (i=0; i < line.length(); i++) {
    col = line.charAt(i) - '1';
    if (col >= 0 && col < WIDTH && c4.isplayable(col))
    c4.makemove(col);
    By the way im using Ready to program for the programming.

    You can't really believe that his brother did this
    for him...I did miss that copyright line at the beginning when
    I first looked it over, but you know, if it had been
    his brother, I'd be kinda impressed. This wasn't a
    25 line program. It actually would have required
    SOME thought. I doubt my brother woulda done that
    for me (notwithstanding the fact that I wouldn't need
    help for that program, and my brother isn't a
    programmer).I originally missed the comments at the top but when I saw the complexity of what was written then I knew that it was too advanced for a beginner and I relooked through the code and saw the comments.

  • Noob Needs Help Making Algorithm !!

    Hi, i just started talking java class at my university & my teacher just hit me with some
    home work which i have no idea how to do.
    This is the first question: (I think I just need a helping hand to get me started)
    Write an algorithm to compute the arrival time of a train, if you know the starting time and the distance to destination (in km). Assume that the average speed of the train is 60km/h. The start time is given as the hour (using 24h notation) and the minutes. For example, if the start time is 13:46, the user will input 13 and 46. Assume that the hour and minutes provided are valid values. The output will consist in two numbers, one for the hours and one for the minutes.
    Example: if the train travels 210 km, and the start time is 10:20, then the arrival time will be 13:50 (actually two numbers representing 13h and 50min).
    THANKS, FROM A DESPERATE NOOB

    slvr99 wrote:
    Assume that the average speed of the train is 60km/h.
    Example: if the train travels 210 km, and the start time is 10:20, then the arrival time will be 13:50 (actually two numbers representing 13h and 50min).The best approach for you I think is to turn the time of the day into minutes. In the example the time of the day is given as 10 hours and 20 minutes. That would be 10*60 + 20 = 620 minutes.
    Then the average speed is given as 60 km/h which translates to 60/60 = 1 km per minute. Each kilometer takes 1 minute (conveniently chosen speed isn't it -:). If the train travels 210 kilometers that will take 210 minutes.
    Now if you add the travel time of 210 minutes to the start time of 620 minutes you get the arrival time. It becomes 620+210 = 830 minutes.
    The final question is how to turn the arrival time given in minutes back to the hour:minute representation? Well how many full hours is 830 minutes. You can calculate that by doing an integer division of 830 with 60. The integer division will scrap the fractional par leaving only full hours. This is 830/60 = 13 hours. Finally the 13 hours represent 13*60 = 780 minutes which you should subtract from the 830 to get the minutes that didn't amount to a full hour. This is 830-780=50 minutes. So the arrival time will be 13 hours and 50 minutes, or 13:50.

  • To open "Java Preferences," you need to install a Java runtime, but you are not connected to the Internet. I have tried links that people have put on other discussions but all i get is a black screen please help!!

    To open “Java Preferences,” you need to install a Java runtime, but you are not connected to the Internet. I have tried links that people have put on other discussions but all i get is a black screen please help!!

    Try this link, warning, it's straight to download mode:
    http://support.apple.com/downloads/DL1421/en_US/JavaForMacOSX10.7.dmg

  • HT3633 I have an error message that reads: java.lang.noclassdefFounder - need to fix can anyone help?

    I have an error message that reads: java.lang.noclassdefFounder - need to fix can anyone help?

    That's a bug in whatever Java program you're running.
    That's not an error specific to OS X.
    (There's usually a whole lot more text dumped by Java, too.)
    Check with whoever wrote or is supporting the package you're working with.

Maybe you are looking for

  • Opening and editing a PDF in INDESIGN

    I am trying to edit a newsletter that was created by someone else using INDESIGN.  It is now a PDF.  I downloaded the free 30-day trial version of INDESIGN and cannot even open the PDF using said software.  Can someone please offer any suggestions or

  • Exception in Message mapping for JDBC - XI- file

    Hi, In the above scenario, Sender JDBC adapter has processed the message but when i checked the processed XML messages, its giving an error message with details <i>During the application mapping com/sap/xi/tf/_MM_XXXX_a com.sap.aii.utilxi.misc.api.Ba

  • Can't right click to set to open a pdf in to photosop?

    When ever i try saving to a pdf from photoshop, it says the following:''preserve photoshop editing capabilities is incompatible with earlier versions of photoshop.In earlier versions you must open the pdf as a generic pdf'' I cant right click on the

  • Data extraction from string

    I'm trying to search a particular value in a string file. The string contains many parameters followed by their values and units. I want to identify and extract, as a number, the value of a particular parameter. The program will basically ask the use

  • Issues when a cross platform android app is run on Blackberry 10 alpha simulator

    I am facing problems in running a cross platform android App in blackberry 10 Alpha simulator.The App works fine when run in iphone,android devices.But when I run it in blackberry 10 it doesn't load the template files hence a blank screen.The project