Newbie Q: How can I use swing on a Mac

Can anyone tell me how I can get the swing class libraries installed on my Macintosh? According to the MRJ 2.2.5 (Macintosh Runtime for Java) this is compatible with Swing 1.1.1. But where do I get the class library and where do I put it when I have got it. The only info I have is to see:
http://java.sun.com
Well here I am.
Anyone got any ideas.
Thanks.

Here:
http://java.sun.com/products/jfc/download.archive.html

Similar Messages

  • How can I use Pegasus R6 with Mac mini?

    I bought Pegasus R6 (Promise Technology, Inc). I connected to my Mac mini. But Pegasus R6 did not appear on desktop. In order to use Pegasus, MacBook Pro?iMac must have MacBook Pro EFI Firmware Update installed. But Mac mini does not have EFI Firmware Update. How can I use Pegasus R6 with Mac mini?

    Does your Mac Mini have thunderbolt?

  • Hi how can i use imessage from my mac

    hi how can i use imessage from my mac , i tried to text message to one of my contact name but it said the number is not registered with imessage so how can i registered all my contacts to the imessage . thanks

    The person you try to contact has to register his number/his appleID with iMessage.

  • How can i use both Windows and Mac os at the same time on my iMac

    How can i use both Windows and Mac os at the same time on my iMac

    You can use Parallels desktop or VM Fusion to run both operating systems at the same time. Both programs work well, but I personally perfer VM Fusion.

  • HOW CAN I USE FACETIME IN MY MAC TO SPEAK WITH MEXICO??

    HOW CAN I USE FACETIME IN MY MAC TO SPEAK WITH MEXICO??

    where are you located? in some middle eastern countries facetime is blocked by the government.

  • HT5395 How can I use Messages on my Mac if it is not already set up?

    I am trying to use iMessage on my mac, but the Messages app doesn't seem to be set up on my computer. How can I get this app set up?

    What OS version are you running. Messages is only available on 10.8.x, Mountain Lion.

  • How can I use Back to My Mac using my Apple ID

    I'm having problems accessing my other computers using Back to My Mac. I've gone into System Prefference>iCloud and turn on Back to My Mac on all mey devices. I've have also gone into my router settings and opened the appropriate ports. I can see my other divices in Finder. When I go to connect I am given a choice of "As a registered user" which works sometimes and not others and also "Using an Apple ID" when I choose this option my Apple ID appears in the drop down box (and is the only option in the drop down box). Howevere, when I click "Connect" it comes up with Authentication failed to JQ MacBook Air.
    Any Ideas

    Hi,
    Are they both using the same iCloud account/ Apple ID?
    http://support.apple.com/kb/HT4907

  • URGENT!! How can I use ipod both on mac and windows

    im using the new 5th gen video ipod. I have ibook and ipod is formated for mac but i need to use to atleast store data from windows pc in college how should i do that?? when connecvted to win Pc it says it needs to be formated. please help??

    Install a program such as this one on the PC; you can then transfer files to the iPod on the PC.
    (10468)

  • How can I use Back to my Mac when my ISP blocks port 1900?

    I was just forced to switch ISPs (don't ask...) and it turns out that my new ISP (Astound) lied to me and actually does block port 1900, which means that Back to my Mac (on which I rely) does not work.
    Has anyone seen this and found a viable workaround? Preferably one that is easy for my non-technical family to use also, but all suggestions are welcome.
    Thank you!

    So, I convinced my ISP to open port 1900 and they did, but it's still not working.
    I get two messages that make no sense to me, but I hope indicated something that someone here can help me undertstand...
    When I open the iCloud preference pane in System Preferences, It says just below the Back to my Mac setting "Configure Router for better performance" - My Airport Extreme is configured with  Back to my Mac and it looks like my account shows a green indicator.
    Second, next to the Back to my Mac setting in the iCloud preference pane, there is a button labeled "Details..." When I click that it tells me that "Back to my Mac is not working properly because the DNS server isnt' responding" and suggests I contact my ISP for a different DNS server.
    All other internet services - including iCloud services - are working fine. I even tried changing my DNS servers to Google's public DNS servers and nothing changed.
    Any suggestions are very much appreciated! Thank you!

  • How can i use Mail on 2 macs with the same mail address?

    Hi,
    I have two Macs, connected through WLAN. From each Mac I can use Mail (sending and receiving) with the same mail address. This worked well; on each Mac I have separate files storing the mails (input, sent, trash, …).
    Some days ago I had to change the provider. (Perhaps this may be the reason for my problem?) Now both mail systems are connected - in the way that if I put on Mac *1 a mail into the trash it is automatically thrown into the trash on Mac *2.
    What is to be done to separate the two systems (i. e. make them independent of each other)?
    Hans

    It looks like you are using a IMAP mail account, a protocol used by most email providers nowadays. Read -> http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol
    The main feature of IMAP is the sync of all the changes you do on your mail account. If you want to keep your mails on one Mac, have a look at this site -> http://kb.mit.edu/confluence/pages/viewpage.action?pageId=3908294

  • How can I use IMac speakers on Mac Bk Pro?

    I wantto use my Older IMac speakers (small, clear, round,cute) on my Mac book pro.  Of course, it can't be a simple as "plugging them in".  The plug on the speakers is larger than the openning on the PRO.  
    I'm thinking a gadget between the two should work but What?

    This might help you:
    https://discussions.apple.com/thread/756283?threadID=756283&tstart=-1

  • How can I use share internet from Mac to iphone usb

    What I did is check the share internet option from Mac -> from Ethernet to iphone usb.
    It doesn't work.
    No internet connected in iphone!
    I don't want connect through wifi.
    Please help.

    Sync using iTunes: http://support.apple.com/kb/HT1386

  • I have a passport external hard. previously, I used it on windows, then I changed my laptop to mac. Now, It's only read. How can I use it for copying files on it on mac? I don wanna use it on windows again.

    I have a passport external hard. previously, I used it on windows, then I changed my laptop to mac. Now, It's only read. How can I use it on my mac for copying files on my passport? I don wanna use it on windows again.

    If you're not going to use the drive on a Windows machine, you should use Disk Utility (Applications>Utilities folder) to erase the drive and format it as "Mac OS Extended (Journaled)" with a single GUID partition (default):
    Good luck,
    Clinton

  • How can i use RTFEditorKit for JTextField.

    hi all,
    how can i use RTFEditorKit for JTextField.
    thanks in advance
    daya

    Don't cross post. This is a Swing related question and you have already posted in the Swing forum:
    http://forum.java.sun.com/thread.jspa?threadID=619619&tstart=0

  • How can I use XStream to persist complicated Java Object  to XML & backward

    Dear Sir:
    I met a problem as demo in my code below when i use XTream to persist my Java Object;
    How can I use XStream to persist complicated Java Object to XML & backward??
    See
    [1] main code
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import com.thoughtworks.xstream.XStream;
    import com.thoughtworks.xstream.io.xml.DomDriver;
    public class PhoneList {
         ArrayList<PhoneNumber> phones;
         ArrayList<Person> person;
         private PhoneList myphonelist ;
         private LocationTest location;
         private PhoneList(String name) {
         phones = new ArrayList<PhoneNumber>();
         person = new ArrayList<Person>();
         public ArrayList<PhoneNumber> getphones() {
              return phones;
         public ArrayList<Person> getperson() {
              return person;
         public void addPhoneNumber(PhoneNumber b1) {
              this.phones.add(b1);
         public void removePhoneNumber(PhoneNumber b1) {
              this.phones.remove(b1);
         public void addPerson(Person p1) {
              this.person.add(p1);
         public void removePerson(Person p1) {
              this.person.remove(p1);
         public void BuildList(){
              location = new LocationTest();
              XStream xstream = new XStream();
              myphonelist = new PhoneList("PhoneList");
              Person joe = new Person("Joe, Wallace");
              joe.setPhone(new PhoneNumber(123, "1234-456"));
              joe.setFax(new PhoneNumber(123, "9999-999"));
              Person geo= new Person("George Nixson");
              geo.setPhone(new PhoneNumber(925, "228-9999"));
              geo.getPhone().setLocationTest(location);          
              myphonelist.addPerson(joe);
              myphonelist.addPerson(geo);
         public PhoneList(){
              XStream xstream = new XStream();
              BuildList();
              saveStringToFile("C:\\temp\\test\\PhoneList.xml",convertToXML(myphonelist));
         public void saveStringToFile(String fileName, String saveString) {
              BufferedWriter bw = null;
              try {
                   bw = new BufferedWriter(
                             new FileWriter(fileName));
                   try {
                        bw.write(saveString);
                   finally {
                        bw.close();
              catch (IOException ex) {
                   ex.printStackTrace();
              //return saved;
         public String getStringFromFile(String fileName) {
              BufferedReader br = null;
              StringBuilder sb = new StringBuilder();
              try {
                   br = new BufferedReader(
                             new FileReader(fileName));
                   try {
                        String s;
                        while ((s = br.readLine()) != null) {
                             // add linefeed (\n) back since stripped by readline()
                             sb.append(s + "\n");
                   finally {
                        br.close();
              catch (Exception ex) {
                   ex.printStackTrace();
              return sb.toString();
         public  String convertToXML(PhoneList phonelist) {
              XStream xstream = new  XStream(new DomDriver());
              xstream.setMode(xstream.ID_REFERENCES) ;
              return xstream.toXML(phonelist);
         public static void main(String[] args) {
              new PhoneList();
    }[2].
    import java.io.Serializable;
    import javax.swing.JFrame;
    public class PhoneNumber implements Serializable{
           private      String      phone;
           private      String      fax;
           private      int      code;
           private      String      number;
           private      String      address;
           private      String      school;
           private      LocationTest      location;
           public PhoneNumber(int i, String str) {
                setCode(i);
                setNumber(str);
                address = "4256, Washington DC, USA";
                school = "Washington State University";
         public Object getPerson() {
              return null;
         public void setPhone(String phone) {
              this.phone = phone;
         public String getPhone() {
              return phone;
         public void setFax(String fax) {
              this.fax = fax;
         public String getFax() {
              return fax;
         public void setCode(int code) {
              this.code = code;
         public int getCode() {
              return code;
         public void setNumber(String number) {
              this.number = number;
         public String getNumber() {
              return number;
         public void setLocationTest(LocationTest bd) {
              this.location = bd;
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(location);
            f.getContentPane().add(location.getControls(), "Last");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
         public LocationTest getLocationTest() {
              return location;
         }[3].
    package test.temp;
    import java.io.Serializable;
    public class Person implements Serializable{
         private String           fullname;
           @SuppressWarnings("unused")
         private PhoneNumber      phone;
           @SuppressWarnings("unused")
         private PhoneNumber      fax;
         public Person(){
         public Person(String fname){
                fullname=fname;           
         public void setPhone(PhoneNumber phoneNumber) {
              phone = phoneNumber;
         public void setFax(PhoneNumber phoneNumber) {
              fax = phoneNumber;
         public PhoneNumber getPhone() {
              return phone ;
         public PhoneNumber getFax() {
              return fax;
        public String getName() {
            return fullname ;
        public void setName(String name) {
            this.fullname      = name;
        public String toString() {
            return getName();
    }[4]. LocationTest.java
    package test.temp;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class LocationTest extends JPanel implements ChangeListener
        Ellipse2D.Double ball;
        Line2D.Double    line;
        JSlider          translate;
        double           lastTheta = 0;
        public void stateChanged(ChangeEvent e)
            JSlider slider = (JSlider)e.getSource();
            String name = slider.getName();
            int value = slider.getValue();
            if(name.equals("rotation"))
                tilt(Math.toRadians(value));
            else if(name.equals("translate"))
                moveBall(value);
            repaint();
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(ball == null)
                initGeom();
            g2.setPaint(Color.green.darker());
            g2.draw(line);
            g2.setPaint(Color.red);
            g2.fill(ball);
        private void initGeom()
            int w = getWidth();
            int h = getHeight();
            int DIA = 30;
            int padFromEnd = 5;
            line = new Line2D.Double(w/4, h*15/16, w*3/4, h*15/16);
            double x = line.x2 - padFromEnd - DIA;
            double y = line.y2 - DIA;
            ball = new Ellipse2D.Double(x, y, DIA, DIA);
            // update translate slider values
            int max = (int)line.getP1().distance(line.getP2());
            translate.setMaximum(max);
            translate.setValue(max-padFromEnd);
        private void tilt(double theta)
            // rotate line from left end
            Point2D pivot = line.getP1();
            double lineLength = pivot.distance(line.getP2());
            Point2D.Double p2 = new Point2D.Double();
            p2.x = pivot.getX() + lineLength*Math.cos(theta);
            p2.y = pivot.getY() + lineLength*Math.sin(theta);
            line.setLine(pivot, p2);
            // find angle from pivot to ball center relative to line
            // ie, ball center -> pivot -> line end
            double cx = ball.getCenterX();
            double cy = ball.getCenterY();
            double pivotToCenter = pivot.distance(cx, cy);
            // angle of ball to horizon
            double dy = cy - pivot.getY();
            double dx = cx - pivot.getX();
            // relative angle phi = ball_to_horizon - last line_to_horizon
            double phi = Math.atan2(dy, dx) - lastTheta;
            // rotate ball from pivot
            double x = pivot.getX() + pivotToCenter*Math.cos(theta+phi);
            double y = pivot.getY() + pivotToCenter*Math.sin(theta+phi);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
            lastTheta = theta;  // save theta for next time
        private void moveBall(int distance)
            Point2D pivot = line.getP1();
            // ball touches line at distance from pivot
            double contactX = pivot.getX() + distance*Math.cos(lastTheta);
            double contactY = pivot.getY() + distance*Math.sin(lastTheta);
            // find new center location of ball
            // angle lambda = lastTheta - 90 degrees (anti-clockwise)
            double lambda = lastTheta - Math.PI/2;
            double x = contactX + (ball.width/2)*Math.cos(lambda);
            double y = contactY + (ball.height/2)*Math.sin(lambda);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
        JPanel getControls()
            JSlider rotate = getSlider("rotation angle", "rotation", -90, 0, 0, 5, 15);
            translate = getSlider("distance from end",  "translate", 0, 100, 100,25, 50);
            JPanel panel = new JPanel(new GridLayout(0,1));
            panel.add(rotate);
            panel.add(translate);
            return panel;
        private JSlider getSlider(String title, String name, int min, int max,
                                  int value, int minorSpace, int majorSpace)
            JSlider slider = new JSlider(JSlider.HORIZONTAL, min, max, value);
            slider.setBorder(BorderFactory.createTitledBorder(title));
            slider.setName(name);
            slider.setPaintTicks(true);
            slider.setMinorTickSpacing(minorSpace);
            slider.setMajorTickSpacing(majorSpace);
            slider.setPaintLabels(true);
            slider.addChangeListener(this);
            return slider;
    }OK, My questions are:
    [1]. what I generated XML by XSTream is very complicated, especially for object LocationTest, Can we make it as simple as others such as Person object??
    [2]. after I run it, LocationTest will popup and a red ball in a panel will dsiplay, after I change red ball's position, I hope to persist it to xml, then when I read it back, I hope to get same picture, ie, red ball stiil in old position, How to do that??
    Thanks a lot!!

    Positive feedback? Then please take this in a positive way: if you want to work on persisting Java objects into XML, then GUI programming is irrelevant to that goal. The 1,000 lines of code you posted there appeared to me to have a whole lot of GUI code in it. You should produce a smaller (much smaller) example of what you want to do. Calling the working code from your GUI program should come later.

Maybe you are looking for

  • My Mac Pro Experience

    Got my stock 2.66 MP about a week ago and wanted to use it for a bit before giving my impressions. I run a graphic design business and am trading up from a 3-year old G5 dual 2.0. My primary workflow is in Photoshop, Illustrator and InDesign, plus al

  • Nokia Music Voucher - Lumia 520

    My lumia 520 mobile, i cant download music from Nokia music free, the eror occurs that redeem a code Moderator's note: The subject was edited as we the post was moved to the appropriate board. Solved! Go to Solution.

  • My ipad have wi-fi only  and i need to know who i can go though to get intertnet

    my ipad is wi-fi only and i need to know where i can get internet service

  • The difference between symbols in CS4 & CS5?!

    Whenever I would break the link to a symbol in CS4, it would still stay in it's own group. Now in CS5, it becomes it's own Sub/Layer?!? Not a fan. Is there any pref that I'm missing? Also, whenever I hit the green light in the upper left stop light t

  • Autocomplete in Web Dynpro

    How to enable Auto-complete in web dynpro abap? just like in sap gui, client side every inputfield entered value gets stored, as and when we press back button in the inputfields it lists previously entered values list. Abhi