Here is the code, only swing components behave badly, awt components seemok

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import java.lang.*;
public class gui extends JPanel{
String[] infochoice = {"Postcode","Locality","State","BSP"};
JComboBox infowanted;
JLabel lab;
Choice cho;
public static JButton quit;
public gui(){
infowanted = new JComboBox(infochoice);
infowanted.setEditable(false);
infowanted.setSelectedIndex(0);
infowanted.setEnabled(true);
lab = new JLabel("Select one");
lab.setText("<html><font color=blue> Please select one</font></html>");
cho = new Choice();
cho.add("Postcode");
cho.add("Locality");
cho.add("State");
cho.add("BSP");
quit = new JButton("QUIT");
     ActionListener actlist = new ActionListener(){
public void actionPerformed(ActionEvent e){
if(e.getSource() == quit) {
     System.exit(0);
add(lab);
//add(infowanted);
add(cho);
add(quit);
public static void main (String args[]) {
String feel = UIManager.getSystemLookAndFeelClassName();
try{
UIManager.setLookAndFeel(feel);
catch (Exception e){
System.err.println(e);
JFrame frame = new JFrame("Kyri");
JPanel panel = new gui();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(panel);
frame.pack();
frame.setVisible(true);
frame.setSize(300,100);

So for me... and by the way, what is your problem ?
NOTE: Did you read about NOT mixing AWT and SWING ?...

Similar Messages

  • Please Please Help with Projectile Project Here are the Codes

    I've got three(3) classes a Model, a view, and a controller.
    This is a project about projectiles.it is an animation of a cannonball being fired from a cannon and travelling under the effect of gravity.A cannon fired at angle 'a' to the horizontal and with an initial speed 's', will have an initial velocity given by:
    vx := s * cos(a);//velocity x equals the speed multiply by the cosine of angle a.
    vy := s * sin(a);//velocity y equals the speed multiply by the sine of angle a.
    Here are the code.
    Model:
    /** Cannon specifies the expected behaviour of a cannon*/
    public class Cannon{
    public static final int TICK = 60;
    private int velocity = 0;
    private static final double gravity = .098f;
    private double angle = 0;
    // distances & positions are meausred in pixels
    private int x_pos; // ball's center x-position
    private int y_pos; // ball's center y-position
    // speed is measured in pixels per `tick'
    private int x_velocity; // horizonal speed; positive is to the right
    private int y_velocity; // vertical speed; positive is downwards
    public Cannon() {
    velocity = 3;
    angle = 60;
    angle = radians(angle);
    x_pos = 0;
    y_pos = 385;
    /** shoot fires a shot from the cannon*/
    public void shoot(){
    move();
    /**reload reloads the cannon with more shorts*/
    public void reload() {
    /** changeAngle changes the angle of the canon
    * @params value - the amount to add or subtract from the current angle value*/
    public void changeAngle(double value) {
    angle = (double)value;
    angle = radians(angle);
    /** getAngle returns the current angle value of the cannon*/
    public double getAngle() {
    return angle;
    /** changeVelocity changes the speed at which a cannon ball that is to be fire will travel at
    * @params value - the new speed at which the user wants a cannon ball to travel at.*/
    public void changeVelocityX(int value){
    x_velocity = x_velocity * (int)Math.cos(value);
    public void changeVelocityY(int value){
    y_velocity = y_velocity * (int)Math.sin(value);
    /** getVelocity returns the current velocity value of the cannon*/
    public int getVelocityX() {
    return x_velocity;
    public int getVelocityY() {
    return y_velocity;
    /** getGravity returns the current gravity value of the cannon*/
    public double getGravity() {
    return gravity;
    public int xPosition(){
    return x_pos;
    public int yPosition(){
    return y_pos;
    public void move(){
    double dx = getVelocityX() * Math.cos(getAngle());
    double dy = getVelocityY() * Math.sin(getAngle());
    x_pos+=dx;
    y_pos-=dy;
    double radians (double angle){
    return ((Math.PI * angle) / 180.0);
    View:
    import java.awt.*;
    import javax.swing.*;
    /** CannonView displays a cannon being fired.*/
    public class CannonView extends JPanel{
    /** DISPLAY_SIZE specifies the overall display area of the cannon and the bucket.*/
    public static final int DISPLAY_AREA_SIZE = 600;
    public RotatablePolygon rectangle;
    public RotatablePolygon triangle;
    public Cannon cannon;
    public CannonView(Cannon c) {
    this.setPreferredSize(new Dimension(600,450));
    this.setBackground(Color.black);
    cannon = c;
    int xRectangle[] = {0,0,40,40,0};
    int yRectangle[] = {400,300,300,400,400};
    int xTriangle[] = {0,20,40,0};
    int yTriangle[] = {300,280,300,300};
    rectangle = new RotatablePolygon (xRectangle, yRectangle, 5,20,350);
    // rectangle.setPosition (100, 100);
    // triangle = new RotatablePolygon (xTriangle, yTriangle, 4,0,290);
    triangle = new RotatablePolygon (xTriangle, yTriangle, 4,20,350);
    //triangle.setPosition (100, 100);
    JFrame frame = new JFrame();
    frame.getContentPane().add(this);
    frame.pack();
    frame.setVisible(true);
    frame.setTitle("Width = " + frame.getWidth() + " , Height = " + frame.getHeight());
    /** drawBucket draws a bucket/target for which a moving cannon ball should hit.
    * @param g - the graphics pen for which the drawing should occur.*/
    public void drawBucket(Graphics g) {
    g.setColor(Color.red);
    int xvalues[] = {495, 519, 575, 595, 495};
    int yvalues[] = {340, 400, 400, 340, 340};
    Polygon poly1 = new Polygon (xvalues, yvalues, 5);
    g.fillPolygon(poly1);
    g.setColor(Color.white);
    g.fillOval(495, 328, 100, 24);
    Graphics2D g2d = (Graphics2D)g;
    g2d.setStroke(new BasicStroke(2));
    g.setColor(Color.red);
    g.drawOval(495, 328, 100, 24);
    g.drawOval(495,311,100,54);
    /** drawCannon draws a cannon
    * @param g - the graphics pen that will be used to draw the cannon.*/
    public void drawCannon(Graphics g) {
    Graphics2D g2 = (Graphics2D)g;
    g.setColor(Color.red);
    g2.fill(rectangle);
    g.setColor(Color.orange);
    g2.fill(triangle);
    g.setColor(Color.blue);
    g.fillOval(95, 340, 60, 60);
    g.setColor(Color.magenta);
    for (int i = 0; i < 6; i++){
    g.fillArc(95, 340, 60, 60, i* 60, 30);
    g.setColor(Color.black);
    g.fillOval(117, 362, 16, 16);
    /** drawCannonShots will draw the actual number of shots already used by the cannon
    * @param g - the graphics pen that will be used to draw the shots of the cannon.*/
    public void drawCannonShots(Graphics g) {
    g.setColor(Color.orange);
    g.fillOval(cannon.xPosition(),cannon.yPosition(),16,16);
    /** drawTrail will draw a trail of smoke to indicate where a cannon ball has passed
    * @param g - the graphics pen used to draw the trail.*/
    public void drawTrail(Graphics g){}
    /**drawGround draws the ground for which the cannon sits*/
    public void drawGround(Graphics g) {
    g.setColor(Color.green.brighter());
    g.fillRect(0,400,600,50);
    /** drawMovingCannonBall draw a cannon ball moving at a certain speed (velocity),
    * with a certain amount of gravitational acting upon it, at a certain angle.
    * @params g - the graphics pen used to draw the moving cannon ball.
    * @params gravity - the value of gravity.
    * @params velocity - the speed at which the ball is travelling.
    * @params angle - the angle at which the ball was shot from.*/
    public void drawMovingCannonBall(Graphics g, double gravity, double velocity, double angle){}
    /** paintComponent paints the cannon,bucket
    * @param g - graphics pen.*/
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    drawGround(g);
    drawBucket(g);
    drawCannon(g);
    drawCannonShots(g);
    Controller
    /** CannonController controls the interaction between the user and a cannon*/
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class CannonController extends JFrame{
    public JMenuBar jMenuBar2;
    public JMenu jMenu2;
    public JMenuItem jMenuItem1;
    public JMenu jMenu3;
    public JMenuItem jMenuItem2;
    public JLabel angleLabel, velocityLabel;
    public JTextField angleTextField, velocityTextField;
    public JButton fireButton, reloadButton;
    public JSlider angleSlider, velocitySlider;
    private CannonView view;
    private Cannon cannon;
    int oldValue, newValue;
    public CannonController(Cannon acannon) {
    cannon = acannon;
    view = new CannonView(cannon);
    loadControls();
    angleTextField.setText(String.valueOf(angleSlider.getValue()));
    oldValue = angleSlider.getValue();
    newValue = oldValue + 1;
    velocityTextField.setText(String.valueOf(velocitySlider.getValue()));
    this.setSize(328,308);
    this.setLocation(view.getWidth()-this.getWidth(),0);
    /** loadControl loads all of the GUI controls that a
    * user of the cannon animation will use to interact with the program*/
    public void loadControls() {
    jMenuBar2 = new JMenuBar();
    jMenu2 = new JMenu();
    jMenuItem1 = new JMenuItem();
    jMenu3 = new JMenu();
    jMenuItem2 = new JMenuItem();
    angleLabel = new JLabel();
    velocityLabel = new JLabel();
    angleTextField = new JTextField();
    velocityTextField = new JTextField();
    fireButton = new JButton();
    reloadButton = new JButton();
    angleSlider = new JSlider();
    velocitySlider = new JSlider();
    jMenuBar2.setBorderPainted(false);
    jMenu2.setModel(jMenu2.getModel());
    jMenu2.setText("File");
    jMenuItem1.setText("Exit");
    jMenuItem1.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    jMenuItem1ActionPerformed(evt);
    jMenu2.add(jMenuItem1);
    jMenuBar2.add(jMenu2);
    jMenu3.setText("Help");
    jMenuItem2.setText("About this Program");
    jMenuItem2.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    jMenuItem2ActionPerformed(evt);
    jMenu3.add(jMenuItem2);
    jMenuBar2.add(jMenu3);
    getContentPane().setLayout(null);
    setTitle("Cannon Controller Form");
    setResizable(false);
    setMenuBar(getMenuBar());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    exitForm(evt);
    angleLabel.setText("Angle:");
    getContentPane().add(angleLabel);
    angleLabel.setLocation(10, 20);
    angleLabel.setSize(angleLabel.getPreferredSize());
    velocityLabel.setText("Velocity:");
    getContentPane().add(velocityLabel);
    velocityLabel.setLocation(10, 80);
    velocityLabel.setSize(velocityLabel.getPreferredSize());
    angleTextField.setToolTipText("Only numeric values are allow");
    getContentPane().add(angleTextField);
    angleTextField.setBounds(280, 20, 30, 20);
    velocityTextField.setToolTipText("Only numeric values are allow");
    getContentPane().add(velocityTextField);
    velocityTextField.setBounds(280, 80, 30, 20);
    fireButton.setToolTipText("Click to fire a shot");
    fireButton.setText("Fire");
    fireButton.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    fireButtonMouseClicked(evt);
    getContentPane().add(fireButton);
    fireButton.setBounds(60, 160, 80, 30);
    reloadButton.setToolTipText("Click to reload cannon");
    reloadButton.setText("Reload");
    reloadButton.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent evt) {
    reloadButtonMouseClicked(evt);
    getContentPane().add(reloadButton);
    reloadButton.setBounds(150, 160, 80, 30);
    angleSlider.setMinorTickSpacing(30);
    angleSlider.setPaintLabels(true);
    angleSlider.setPaintTicks(true);
    angleSlider.setMinimum(0);
    angleSlider.setMajorTickSpacing(60);
    angleSlider.setToolTipText("Change the cannon angle");
    angleSlider.setMaximum(360);
    angleSlider.setValue(0);
    angleSlider.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
    angleSliderStateChanged(evt);
    getContentPane().add(angleSlider);
    angleSlider.setBounds(60, 20, 210, 40);
    velocitySlider.setMinorTickSpacing(5);
    velocitySlider.setPaintLabels(true);
    velocitySlider.setPaintTicks(true);
    velocitySlider.setMinimum(1);
    velocitySlider.setMajorTickSpacing(10);
    velocitySlider.setToolTipText("Change the speed of the cannon ball");
    velocitySlider.setMaximum(28);
    velocitySlider.setValue(3);
    velocitySlider.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent evt) {
    velocitySliderStateChanged(evt);
    getContentPane().add(velocitySlider);
    velocitySlider.setBounds(60, 80, 210, 50);
    setJMenuBar(jMenuBar2);
    pack();
    private void reloadButtonMouseClicked(MouseEvent evt) {
    reloadButtonClick();
    private void fireButtonMouseClicked(MouseEvent evt) {
    fireButtonClick();
    /** firstButtonClick is the event handler that sends a message
    * to the cannon class to invokes the cannon's fire method*/
    public void fireButtonClick() {
    // JOptionPane.showMessageDialog(null,"You click Fire");
    cannon.shoot();
    view.repaint();
    /** reloadButtonClick is the event handler that sends a message
    * to the cannon class to invokes the cannon's reload method*/
    public void reloadButtonClick() {
    JOptionPane.showMessageDialog(null,"reload");
    private void angleSliderStateChanged(ChangeEvent evt) {
    angleTextField.setText(String.valueOf(angleSlider.getValue()));
    view.rectangle.setAngle(angleSlider.getValue() * (Math.PI / 180));
    view.triangle.setAngle(angleSlider.getValue() * (Math.PI / 180));
    cannon.changeAngle(angleSlider.getValue());
    view.repaint();
    private void velocitySliderStateChanged(ChangeEvent evt) {
    velocityTextField.setText(String.valueOf(velocitySlider.getValue()));
    cannon.changeVelocityX(velocitySlider.getValue());
    private void gravitySliderStateChanged(ChangeEvent evt) {
    private void jMenuItem1ActionPerformed(ActionEvent evt) {
    System.exit (0);
    private void jMenuItem2ActionPerformed(ActionEvent evt) {
    String message = "Cannon Animation\n"+
    "Based on the Logic of Projectiles";
    JOptionPane.showMessageDialog(null,message,"About this program",JOptionPane.PLAIN_MESSAGE);
    /** Exit the Application */
    private void exitForm(WindowEvent evt) {
    System.exit (0);
    /** Pause execution for t milliseconds. */
    private void delay (int t) {
    try {
    Thread.sleep (t);
    } catch (InterruptedException e) {}
    public static void main(String [] args){
    Cannon cn = new Cannon();
    CannonController control = new CannonController(cn);
    control.setTitle("Test");
    control.setVisible(true);
    if the cannon ball land in the bucket it should stop and the animation should indicate a 'hit' in some way. maybe by displaying a message.
    if the cannonball hits the outside of the bucket it should bounce off.
    Extra Notes.
    1) The acceleration due to gravity is 9.8m/s to the (power of (2) eg s2.
    2) The distance travelled in time t by a body with initial velocity v under constant acceleration a is:
    v * t + a * t.pow(2) div 2;
    The velocity at the end of time t will be v + a * t.
    Distance is measure in pixels rather than meter so for simplicity we use 1 pixel per meter
    When i pressed the fire button nothings happens. I'm going crazy. Please please help!

    Here is the interface specification for the RotatablePolygon class. I do not have the actual .java source.
    Thanks
    Class RotatablePolygon
    java.lang.Object
    |
    --java.awt.geom.Area
    |
    --RotatablePolygon
    All Implemented Interfaces:
    java.lang.Cloneable, java.awt.Shape
    public class RotatablePolygon
    extends java.awt.geom.Area
    Polygons which can be rotated around an `anchor' point and also translated (moved in the x and y directions).
    Constructor Summary
    RotatablePolygon(int[] xs, int[] ys, int n, double x, double y)
    Create a new RotatablePolyogon with given vertices and anchor point (x,y).
    Method Summary
    double getAngle()
    The current angle of rotation.
    double getXanchor()
    x-coordinate of the anchor point.
    double getYanchor()
    y-coordinate of the anchor point.
    void rotate(double da)
    Rotate the polygon from its current position by angle da (in radians) around the anchor.
    void rotateDegrees(double da)
    Rotate the polygon from its current position by angle da (in degrees) around the anchor.
    void setAngle(double a)
    Set the angle of rotation of the polygon to be angle a (in radians) around the anchor.
    void setAngleDegrees(double a)
    Set the angle of rotation of the polygon to be angle a (in degrees) around the anchor.
    void setPosition(double x, double y)
    Shift the polygon's position to put its anchor point at (x,y).
    void translate(double dx, double dy)
    Shift the polygon's position and anchor point by given amounts.
    Methods inherited from class java.awt.geom.Area
    add, clone, contains, contains, contains, contains, createTransformedArea, equals, exclusiveOr, getBounds, getBounds2D, getPathIterator, getPathIterator, intersect, intersects, intersects, isEmpty, isPolygonal, isRectangular, isSingular, reset, subtract, transform
    Methods inherited from class java.lang.Object
    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Constructor Detail
    RotatablePolygon
    public RotatablePolygon(int[] xs,
    int[] ys,
    int n,
    double x,
    double y)
    Create a new RotatablePolyogon with given vertices and anchor point (x,y).
    REQUIRE: xs.length >= n && ys.length >= n
    Parameters:
    xs - x-coordinates of vertices
    ys - y-coordinates of vertices
    n - number of vertices
    x - x-coordinate of the rotation anchor
    y - y-coordinate of the rotation anchor
    Method Detail
    setPosition
    public void setPosition(double x,
    double y)
    Shift the polygon's position to put its anchor point at (x,y).
    Parameters:
    x - new x-coordinate for anchor point
    y - new y-coordinate for anchor point
    translate
    public void translate(double dx,
    double dy)
    Shift the polygon's position and anchor point by given amounts.
    Parameters:
    dx - amount to shift by in x-direction
    dy - amount to shift by in y-direction
    setAngle
    public void setAngle(double a)
    Set the angle of rotation of the polygon to be angle a (in radians) around the anchor.
    Parameters:
    a - angle to rotate to, in radians
    setAngleDegrees
    public void setAngleDegrees(double a)
    Set the angle of rotation of the polygon to be angle a (in degrees) around the anchor.
    Parameters:
    a - angle to rotate to, in degrees
    rotate
    public void rotate(double da)
    Rotate the polygon from its current position by angle da (in radians) around the anchor.
    Parameters:
    da - angle to rotate by, in radians
    rotateDegrees
    public void rotateDegrees(double da)
    Rotate the polygon from its current position by angle da (in degrees) around the anchor.
    Parameters:
    da - angle to rotate by, in degrees
    getAngle
    public double getAngle()
    The current angle of rotation.
    getXanchor
    public double getXanchor()
    x-coordinate of the anchor point.
    getYanchor
    public double getYanchor()
    y-coordinate of the anchor point.

  • Capturing the raster of Swing components without actually displaying them?

    My goal is to be able to create an Image/BufferedImage that represents the image of Swing components. Now one solution would be to display the component, take a printscrn of it, and cut the resulting image down so that it only contains the area that the component takes up. However, this requires the component to be displayed to the screen.
    Looking for a solution, I found createImage() in java.awt.Component. I tried that, and got a null image. Going back to the javadocs, I found that the component had to be displayable, which was defined as being visible or packed. I tried inserting the component into a JFrame, packed the frame, and then called createImage, only to get a blank Image. I've also tried displaying the JFrame, calling createImage, and displaying the image, but I've had no luck.
    To display the Images, I've been encapsulating them in ImageIcons and displaying those.
    Any ideas pertaining to a good solution?

    How would I go about doing that? I'm looking through
    the API, but I can't find anything relevant.If you direcytly want to create Image object .. then check.. this... and see my last posting of Brio.java
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=711032
    Note: use setVisible(true);
    before creating buffer = createImage(...) else U will get null Image..
    U can also make a BufferedImage like..
    BufferedImage buffer = new BufferedImage(200, 200, BufferedImage.TYPE_3BYTE_BGR);
    Graphics g = buffer.getGraphics();
    g.setColor(new Color(255, 0, 255));
    g.drawImage(img, x, y, null);
    g.fillRect(200,200);
    g.dispose();

  • How to improve the Performance of Swing Components

    Hi
    I have developed a GUI Framework with Swing components. I observed that when number of components are more, the GUI is slow. Could anybody suggest me the ways to improve the performance of Swing Components
    Thanks

    Hi There - I haven't found issues so far with the speed of the GUI building, it seems fast when compared with .NET applications
    Are you doing any database querying on form load? This can slow down the loading of the GUI, I use persistence in an application and before the GUI is shown the persistence unit logs in to the database and registers itself - it does take 2/3 seconds to register and complete whatever it does before the form builds and shows
    Also check if you are loading/using any network based files on form load, this can also slow down the building considerably as well. Apart from that it's hard to say where your issue may lie apart from removing controls and checking build speed until you find the one that's slowing it down (not a good approach though) I sometimes had to load csv files from a network drive and if the file server is slow or LAN speed isn't great this can also cause a delay, hope you find it.....

  • I have tried another exercise, but again I will need help, here's the code

    hi,
    I have another problem. here's the question pluss the code.
    public interface Patient{
    public void doVisit(float hour);
    public boolean hospitalize();
    1. I will need to write a class name OrdinaryPatient which extends Patient.
    the class will include value int that his name age and another value that will be boolean
    of disease.
    I have to do two constructors. one that don't get values and give them default and the other one
    that does get values.
    another method name docVisit which get a visit to the doctor time visit and will print a message.
    the method hospitalize will hospitalize the patient (and if he will have disease he will get true).
    and for age I have to write methods of get and set.
    2. I will need to write a class of Hipochondriac that extends from OrdinaryPatient.
    I have to do two constructors. one that don't get values and make default and the other one that do get values.
    I will need to ade int by the name of numberOfHospitalize.
    I will need to move the method hospitalize that it will be possible to hospitalize the hypochondriac
    on with the value numberOfHospitalize that his small from 5 and if he will hospitalize he will return
    the value true.
    3. write class PatientClass which will be the method main.
    do 10 objects from OrdinaryPatient, 5 that don't get values and 5 will get randomaly age and
    chronic disease with true.
    do 10 objects from Hipochonidraic, 9 that don't get values and one get all of them.
    save all objects in value from Patinet.
    print for each of them their age.
    print for the OrdinaryPatient alone the method of Hospitalize.
    ok, here's what I did.
    1. OrdinaryPatient
    pbulic class OrdinaryPatient implements Patient{
    private int age;
    private boolean disease;
    public OrdinaryPatient(){
    this.disease=false;
    this.age=0;
    public OrdinaryPatient(int age,boolean ddisase){
    this.disease=disease;
    this.age=age;
    public int getAge(){
    return age;
    public void setDisease(boolean disease){
    this.disease=disease;
    public void setAge(int age){
    this.age=age;
    public void docVisit(){
    System.out.println("Patient's visit is one hour");
    public boolean hospitalize(){
    return false;
    2. public class Hipochondriac extends OrdinaryPatient{
    private = numberOfHospitalize;
    public Hipochondriac();
    super();
    numberOfHospitalize=0;
    public Hipochondriac(int age, boolean diseased, int numberOfHospitalize){
    super(age.diseased);
    setnumberOfHospitalize(numberofHospitalize);
    from here I don't know how to continue.
    3. public class PatientClass{
    public static void main(String args[]){
    patient patinets= new patient[20];
    for (int i=0; i<5; i++){
    patients= new OrdinaryPatient();
    from i'm stuck!!!
    if you can help me to improve it I will appriciate it...
    Einat

    here my result.
    1. public interface Patient{
         public void docVisit(float hour_;
         public boolean hospitalize();
    public class OrdinaryPatient extends Patient
         private int age;
         private boolean disease;
    //constructors
         public OrdinaryPatient(){
              age=20;
              disease=true;
         public OrdinaryPatient(int age, boolean disease) {
              setAge(age);
              this.disease=disease;
    //methods
         public int getAge() {
              return age;
         public void setAge(boolean disease) {
              if(age>0 && age<120)
                   this.age=age;
         //overriding methods.
         public void docVisit(float hour) {
              System.out.println("your visit turn is at "+hour");
         public boolean hospitalize(){
              System.out.println("go to hospital");
              if(disease)
                   return true;
              else
                   return false;
    2. public class Hipochondriac extends OrdinaryPatient{
         private int numberOfHospitalize;
    //constructors
         public Hipochondriac(){
         public Hipochondriac(int age, boolean disease, int numberOfHospipitalize){
              setAge(age);
              this.disease=disease;
              this.numberOfHospitalize=numberOfHospitalize
         //methods
         public int getNumberOfHospitalize(){
              return numberOfHospitalize;
         public void setNumberOfHospitalize(int numberOfHostpitalize){
              if(numberOfHospitalize>0)
                   this.numberOfHospitalize=numberOfHospitalize;
         public boolean hospitalize(){
              if(numberOfHospitalize<5)
                   System.out.println("go to hospital");
                   numberOfHospitalize++;
                   return true;
              else
                   return false;
    3. public class PatientClass
         //constructors
         private PatientClass(String[] args){
              //private methods helps to build the object.
              intialArr(args);
              printAge();
              gotHospital();
    //methods.
    private void intialArr(String[] args){
         int i;//array index
         for(i=0;i<arr.lents/2;i+=2)
              arr=new OrdinaryPatient();
              arr[i+1]=new OridnaryPatient((int)(Math.random()*121),true);
         for(;i<=arr.length-2;i++)
              arr[i]=new Hipochondriac();
         arr[i]=new Hipochondriac(Interget.parseINt(args[0]),
         private void printAge(){
              for(int i=0;i<arr.length;i++)
                   System.out.println(((OrdinaryPatient)arr[i]).getAge());
         private void gotoHospital(){
              for(int i=0;i<arr.length;i++)
    //checking for ordinarypatient objects only
                   if(!(arr[i] instanceof Hipochondriac))
                        //dont need casting
                        arr[i].hospitalize()[
         //main method
         public static void main(String[] args)
              //setting the commandLine array from the main to PatientClass object
              PatientClass pc=new PatientClass(args);
    let me know if it's seems logic to you.
    thank you, Einat     

  • After upgrading to firefox 9.0.1 ,web page not rendering html.It showing the codes only.pls help me .

    if i paste that codes here it is working fine.i dont know in that page why it is happens.It is our mail service

    Do you have security software that acts like a sandbox or uses virtualization to restore files on a next boot?
    See also:
    *http://kb.mozillazine.org/Preferences_not_saved
    *https://support.mozilla.org/kb/Preferences+are+not+saved
    It is possible that there is a problem with the file(s) that store the extensions registry.
    Delete the files extensions.* (e.g. extensions.sqlite, extensions.ini, extensions.cache) and compatibility.ini in the Firefox profile folder to reset the extensions registry.
    *https://support.mozilla.org/kb/Profiles
    New files will be created when required.
    See "Corrupt extension files":
    *http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    *https://support.mozilla.org/kb/Unable+to+install+add-ons
    If you see disabled, not compatible, extensions in "Tools > Add-ons > Extensions" then click the Tools button at the left side of the Search Bar (or click the "Find Updates" button in older Firefox versions) to do a compatibility check or see if there is a compatibility update available.

  • Is it possible to change the product name thorugh Script on terminal. i have created one sh file in which i put the below Script and put that in xcode project ...Here is the code..

    die() {
        echo "$*" >&2
        exit 1
    ProjectName=$1
    appname=$2
    config='Ad Hoc Distribution'
    sdk='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develope r/SDKs/iPhoneOS5.1.sdk'
    project_dir=$(pwd)
    echo using configuration $config
    echo updating version number
    agvtool bump -all
    fullversion="$(agvtool mvers -terse1)($(agvtool vers -terse))"
    echo building version $fullversion
    xcodebuild -project "$ProjectName".xcodeproj -configuration "$config" -sdk $sdk build || die "build failed"
    echo making ipa...
    # packaging
    cd build/"$config"-iphoneos || die "no such directory"
    rm -rf Payload:
    rm -f "$appname".*.ipa
    mkdir Payload
    cp -Rp "$appname.app" Payload/
    # if [ -f "$project_dir"/iTunesArtwork ] ; then
    #    cp -f "$project_dir"/iTunesArtwork Payload/iTunesArtwork
    # fi
    # ipaname="$appname.$fullversion.$(date -u +%Y%m%d%H%M%S).ipa"
    ipaname="$appname.ipa"
    zip -r $ipaname Payload
    echo finished making $ipaname
    . Now i tried to run this sh file thorugh terminal.....thorugh command sh shfilename projectname TEST... After running this command it successfully generated an ipa with name  TEST.ipa...I tried to installed this on my device..but on itunes it is giving message that file is not valid..Please help me out if i forgot to perfom any steps.

    Hi Matthew,
    Just staring at your ActiveX code, it looks fine to me.  My first thought is that this should work as you outlined it, and I've done this sort of thing many times, so I know it can work.  My second thought though, is that what you probably really want is a DataPlugin and not a VBScript.  Then you could just drag&drop the Excel file into the Data Portal and load all the properties and channels you want from the Excel file.  If you have DIAdem 2010 or later you can use the SpreadSheet reader object in the DataPlugin to avoid the Excel ActiveX functions (and Excel's jealously with other applications trying to read a file it has open already).
    Feel free to send me a few sample Excel files and describe what you want to load from the various cells, and I'd be happy to help you get a DataPlugin written to load your data.  You can also email me at [email protected]
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Here is the code....

    <mx:DataGrid 
    id="dg_profile_groups" dataProvider="{first}" width="940" color="#000000"alternatingItemColors="
    [#FFFFFF,#A9A9A9]" verticalScrollPolicy="on" itemClick="item_click(event)">
    <mx:columns>
    <mx:DataGridColumn id="col1" headerText="Label" width="200" dataField="spk_name"/>
    <mx:DataGridColumn id="col2" headerText="Key" width="180" dataField="spk_key"/>
    <mx:DataGridColumn id="col3" headerText="Defaule Value" width="150" dataField="lbl_spk_default_value">
    <mx:itemRenderer>
    <fx:Component>
    <mx:HBox horizontalScrollPolicy="off">
    <fx:Script>
    <![CDATA[
    override public function set data(value:Object):void
    super.data = value; 
    var str_search:String="#"; 
    var str_app:String=data.app_spk_default_value; 
    var str_spk:String=data.spk_default_value; 
    var title_spk_default_value:String; 
    var lbl_spk_default_value:String; 
    if(outerDocument.Get_all_keys.length>0){
    if(str_app!=null && str_app!=""){
    if(str_app.search(str_search)>=0){
    try
    lbl_spk_defaultvalue=
    "[1A]"+data.app_spk_default_value; 
    catch(e:Error){
    lbl_spk_defaultvalue=
    "Error";}
    else
    try
    lbl_spk_defaultvalue=
    "[2A]"+data.app_spk_default_value;}
    catch(e:Error){
    lbl_spk_defaultvalue=
    "Error";}
    title_spk_defaultvalue=data.app_spk_default_value;
    else
    if(str_spk!=null){
    if(str_spk.search(str_search)>=0){
    try
    lbl_spk_defaultvalue=
    "[1]"+data.spk_default_value;}
    catch(e:Error){
    lbl_spk_defaultvalue=
    "Error";}
    else
    try
    lbl_spk_defaultvalue=
    "[2]"+data.spk_default_value;}
    catch(e:Error){
    lbl_spk_defaultvalue=
    "Error";}
    title_spk_defaultvalue=data.spk_default_value;
    if(outerDocument.My_mpf_level>=200){
    var title_x:String=title_spk_default_value;}
    else
    var title_x:String="";}
    if(lbl_spk_defaultvalue==null){
    lbl_spk_defaultvalue=
    "N/A";}
    lkbtn_menu.label=lbl_spk_default_value;
    lkbtn_menu.toolTip=
    "[1]Variable [2]Static [nA]App Specific "+title_x+"";}
    ]]>
    </fx:Script>
    <mx:LinkButton id="lkbtn_menu" textDecoration="underline" click="outerDocument.click_Setting(event)"/>
    </mx:HBox>
    </fx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    <mx:DataGridColumn id="col4" headerText="Active" width="45">
    <mx:itemRenderer>
    <fx:Component>
    <mx:HBox>
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection; 
    override public function set data(value:Object):void
    super.data = value; 
    if(data.isActive==1){
    chkbox_active.selected=
    true;}
    else
    chkbox_active.selected=
    false;}
    ]]>
    </fx:Script>
     <mx:CheckBox id="chkbox_active"/>
     </mx:HBox>
     </fx:Component>
     </mx:itemRenderer>
     </mx:DataGridColumn>
     <mx:DataGridColumn id="col5" headerText="Indexed" width="55">
     <mx:itemRenderer>
     <fx:Component>
     <mx:HBox>
     <fx:Script>
    <![CDATA[
     override public function set data(value:Object):void{
    super.data = value;outerDocument.chk_active=chkbox_active1;
    if(data.isIndexed==1){
    chkbox_active1.selected=
    true;}
    else{
    chkbox_active1.selected=
    false;}
    ]]>
    </fx:Script>
     <mx:CheckBox id="chkbox_active1" click="outerDocument.change_check(event,data)"/>
     </mx:HBox>
     </fx:Component>
     </mx:itemRenderer>
     </mx:DataGridColumn>
     <mx:DataGridColumn id="col6" headerText="Data Type" width="70">
     <mx:itemRenderer>
     <fx:Component>
     <mx:HBox>
     <fx

    So for me... and by the way, what is your problem ?
    NOTE: Did you read about NOT mixing AWT and SWING ?...

  • I need some help...My 17" Macbook Pro keeps randomly shutting down. Here is the code I get after I start it up after a crash...any ideas? Interval Since Last Panic Report:  34210 sec Panics Since Last Report:          1 Anonymous UUID:

    Interval Since Last Panic Report:  34210 sec
    Panics Since Last Report:          1
    Anonymous UUID: FD0A243C-3325-3BE8-68B4-71E20A28CA75
    Anonymous UUID: FD0A243C-3325-3BE8-68B4-71E20A28CA75
    Thu Dec  5 10:41:20 2013
    panic(cpu 0 caller 0xffffff7f9efc6f1a): "GPU Panic: [<None>] 5 3 7f 0 0 0 0 3 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xd2000000 0xffffff80997da000 0x0a5480a2, D0, P2/4\n"@/SourceCache/AppleGraphicsControl/AppleGraphicsControl-3.4.5/src/AppleM uxControl/kext/GPUPanic.cpp:127
    Backtrace (CPU 0), Frame : Return Address
    0xffffff808c8eb710 : 0xffffff801d81d636
    0xffffff808c8eb780 : 0xffffff7f9efc6f1a
    0xffffff808c8eb850 : 0xffffff7f9f32b26c
    0xffffff808c8eb910 : 0xffffff7f9f3fe1f6
    0xffffff808c8eb950 : 0xffffff7f9f3fe254
    0xffffff808c8eb9c0 : 0xffffff7f9f6b7278
    0xffffff808c8ebaf0 : 0xffffff7f9f426ad1
    0xffffff808c8ebb10 : 0xffffff7f9f33203f
    0xffffff808c8ebbc0 : 0xffffff7f9f32fad6
    0xffffff808c8ebdc0 : 0xffffff7f9f330b41
    0xffffff808c8ebea0 : 0xffffff7f9f2cc80a
    0xffffff808c8ebef0 : 0xffffff7f9f94c838
    0xffffff808c8ebf40 : 0xffffff7f9f94b783
    0xffffff808c8ebf60 : 0xffffff801d83e26e
    0xffffff808c8ebfb0 : 0xffffff801d8b3257
          Kernel Extensions in backtrace:
             com.apple.driver.AppleMuxControl(3.4.5)[4F710151-D347-301D-A0BA-81791B3E8D4D]@0 xffffff7f9efb9000->0xffffff7f9efcbfff
    dependency: com.apple.driver.AppleBacklightExpert(1.0.4)[B5B1F368-132E-3509-9ED5-93270E3ABB DD]@0xffffff7f9efb4000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f9de51000
    dependency: com.apple.driver.AppleGraphicsControl(3.4.5)[4A2C8548-7EF1-38A9-8817-E8CB34B8DC A6]@0xffffff7f9efa5000
    dependency: com.apple.iokit.IOACPIFamily(1.4)[A35915E8-C1B0-3C0F-81DF-5515BC9002FC]@0xfffff f7f9e3a4000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f9ef93000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f9ec5d000
    com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f9f2 ca000->0xffffff7f9f56bfff
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f9de51000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f9ef93000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f9ec5d000
    com.apple.nvidia.nv50hal(8.1.6)[3455BCFE-565A-3FE5-9F0B-855BCB6CC9B3]@0xffffff7 f9f56c000->0xffffff7f9f83ffff
    dependency: com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f9f2 ca000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f9de51000
    com.apple.driver.AGPM(100.13.12)[40BECF44-B2F1-3933-8074-AD07B38CA43A]@0xffffff 7f9f94a000->0xffffff7f9f95bfff
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f9de51000
    dependency: com.apple.driver.IOPlatformPluginFamily(5.4.1d13)[04F9C88C-92F3-300B-8C68-4A0B5 F7D8C94]@0xffffff7f9ecc4000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f9ef93000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f9ec5d000
    BSD process name corresponding to current thread: kernel_task
    Mac OS version:
    12F45
    Kernel version:
    Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64
    Kernel UUID: EA38B02E-2B88-309F-BA68-1DE29F605DD8
    Kernel slide:     0x000000001d600000
    Kernel text base: 0xffffff801d800000
    System model name: MacBookPro6,2 (Mac-F22586C8)
    System uptime in nanoseconds: 34120617850106
    last loaded kext at 33919862981698: com.apple.driver.AppleUSBCDC            4.1.23 (addr 0xffffff7f9f97b000, size 16384)
    loaded kexts:
    com.apple.driver.AppleUSBCDC            4.1.23
    com.apple.filesystems.msdosfs            1.8.1
    com.apple.driver.AudioAUUC            1.60
    com.apple.driver.AppleHWSensor            1.9.5d0
    com.apple.iokit.IOUserEthernet            1.0.0d1
    com.apple.driver.AGPM            100.13.12
    com.apple.driver.AppleTyMCEDriver            1.0.2d2
    com.apple.driver.AppleUpstreamUserClient            3.5.12
    com.apple.driver.AppleHDAHardwareConfigDriver            2.4.7fc4
    com.apple.iokit.IOBluetoothSerialManager            4.1.7f4
    com.apple.driver.AppleMikeyHIDDriver            124
    com.apple.GeForce            8.1.6
    com.apple.driver.AppleIntelHDGraphics            8.1.6
    com.apple.iokit.IOBluetoothUSBDFU            4.1.7f4
    com.apple.driver.AppleHDA            2.4.7fc4
    com.apple.Dont_Steal_Mac_OS_X            7.0.0
    com.apple.driver.AppleMikeyDriver            2.4.7fc4
    com.apple.driver.AppleBacklight            170.3.5
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport            4.1.7f4
    com.apple.driver.AppleSMCPDRC            1.0.0
    com.apple.iokit.AppleBCM5701Ethernet            3.6.2b4
    com.apple.driver.AppleSMCLMU            2.0.3d0
    com.apple.driver.AppleLPC            1.6.3
    com.apple.driver.AppleMuxControl            3.4.5
    com.apple.driver.ApplePolicyControl            3.4.5
    com.apple.driver.AirPort.Brcm4331            615.20.17
    com.apple.driver.AppleIntelHDGraphicsFB            8.1.6
    com.apple.driver.AppleSMBusPCI            1.0.11d1
    com.apple.nvidia.NVDAStartup            8.1.6
    com.apple.driver.ACPI_SMC_PlatformPlugin            1.0.0
    com.apple.driver.SMCMotionSensor            3.0.3d1
    com.apple.driver.AppleMCCSControl            1.1.11
    com.apple.filesystems.autofs            3.0
    com.apple.driver.AppleUSBTCButtons            237.1
    com.apple.driver.AppleUSBTCKeyEventDriver            237.1
    com.apple.driver.AppleUSBTCKeyboard            237.1
    com.apple.driver.AppleUSBCardReader            3.3.1
    com.apple.driver.AppleFileSystemDriver            3.0.1
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless            1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib            1.0.0d1
    com.apple.BootCache            34
    com.apple.driver.AppleIRController            320.15
    com.apple.iokit.SCSITaskUserClient            3.5.6
    com.apple.driver.XsanFilter            404
    com.apple.iokit.IOAHCIBlockStorage            2.3.5
    com.apple.driver.AppleAHCIPort            2.6.6
    com.apple.driver.AppleFWOHCI            4.9.9
    com.apple.driver.AppleUSBHub            635.4.0
    com.apple.driver.AppleUSBUHCI            621.4.0
    com.apple.driver.AppleUSBEHCI            621.4.6
    com.apple.driver.AppleSmartBatteryManager            161.0.0
    com.apple.driver.AppleACPIButtons            1.8
    com.apple.driver.AppleRTC            1.5
    com.apple.driver.AppleHPET            1.8
    com.apple.driver.AppleSMBIOS            1.9
    com.apple.driver.AppleACPIEC            1.8
    com.apple.driver.AppleAPIC            1.7
    com.apple.driver.AppleIntelCPUPowerManagementClient            214.0.0
    com.apple.nke.applicationfirewall            4.0.39
    com.apple.security.quarantine            2.1
    com.apple.driver.AppleIntelCPUPowerManagement            214.0.0
    com.apple.iokit.IOSerialFamily            10.0.6
    com.apple.iokit.IOSurface            86.0.4
    com.apple.nvidia.nv50hal            8.1.6
    com.apple.NVDAResman            8.1.6
    com.apple.driver.DspFuncLib            2.4.7fc4
    com.apple.iokit.IOAudioFamily            1.9.2fc7
    com.apple.kext.OSvKernDSPLib            1.12
    com.apple.iokit.IOBluetoothFamily            4.1.7f4
    com.apple.iokit.IOBluetoothHostControllerUSBTransport            4.1.7f4
    com.apple.iokit.IOEthernetAVBController            1.0.2b1
    com.apple.iokit.IOFireWireIP            2.2.5
    com.apple.driver.AppleHDAController            2.4.7fc4
    com.apple.iokit.IOHDAFamily            2.4.7fc4
    com.apple.driver.AppleBacklightExpert            1.0.4
    com.apple.driver.AppleGraphicsControl            3.4.5
    com.apple.iokit.IONDRVSupport            2.3.7
    com.apple.iokit.IO80211Family            530.5
    com.apple.iokit.IONetworkingFamily            3.0
    com.apple.driver.IOPlatformPluginLegacy            1.0.0
    com.apple.driver.IOPlatformPluginFamily            5.4.1d13
    com.apple.driver.AppleSMC            3.1.5d4
    com.apple.driver.AppleSMBusController            1.0.11d1
    com.apple.iokit.IOGraphicsFamily            2.3.7
    com.apple.kext.triggers            1.0
    com.apple.driver.AppleUSBMultitouch            237.3
    com.apple.iokit.IOSCSIBlockCommandsDevice            3.5.6
    com.apple.iokit.IOUSBMassStorageClass            3.5.2
    com.apple.iokit.IOUSBHIDDriver            623.4.0
    com.apple.driver.AppleUSBMergeNub            621.4.6
    com.apple.driver.AppleUSBComposite            621.4.0
    com.apple.iokit.IOSCSIMultimediaCommandsDevice            3.5.6
    com.apple.iokit.IOBDStorageFamily            1.7
    com.apple.iokit.IODVDStorageFamily            1.7.1
    com.apple.iokit.IOCDStorageFamily            1.7.1
    com.apple.iokit.IOAHCISerialATAPI            2.5.5
    com.apple.iokit.IOSCSIArchitectureModelFamily            3.5.6
    com.apple.iokit.IOAHCIFamily            2.5.1
    com.apple.iokit.IOFireWireFamily            4.5.5
    com.apple.iokit.IOUSBUserClient            630.4.4
    com.apple.iokit.IOUSBFamily            635.4.0
    com.apple.driver.AppleEFINVRAM            2.0
    com.apple.driver.AppleEFIRuntime            2.0
    com.apple.iokit.IOHIDFamily            1.8.1
    com.apple.iokit.IOSMBusFamily            1.1
    com.apple.security.sandbox            220.3
    com.apple.kext.AppleMatch            1.0.0d1
    com.apple.security.TMSafetyNet            7
    com.apple.driver.DiskImages            345
    com.apple.iokit.IOStorageFamily            1.8
    com.apple.driver.AppleKeyStore            28.21
    com.apple.driver.AppleACPIPlatform            1.8
    com.apple.iokit.IOPCIFamily            2.8
    com.apple.iokit.IOACPIFamily            1.4
    com.apple.kec.corecrypto            1.0
    System Profile:
    Model: MacBookPro6,2, BootROM MBP61.0057.B0F, 2 processors, Intel Core i7, 2.66 GHz, 4 GB, SMC 1.58f17
    Graphics: Intel HD Graphics, Intel HD Graphics, Built-In, 288 MB
    Graphics: NVIDIA GeForce GT 330M, NVIDIA GeForce GT 330M, PCIe, 512 MB
    Memory Module: BANK 0/DIMM0, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020
    Memory Module: BANK 1/DIMM0, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (5.106.98.100.17)
    Bluetooth: Version 4.1.7f4 12974, 3 service, 13 devices, 3 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: Hitachi HTS545050B9SA02, 500.11 GB
    Serial ATA Device: MATSHITADVD-R   UJ-898
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfd100000 / 2
    USB Device: Built-in iSight, apple_vendor_id, 0x8507, 0xfd110000 / 4
    USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd120000 / 3
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfa100000 / 2
    USB Device: Internal Memory Card Reader, apple_vendor_id, 0x8403, 0xfa130000 / 5
    USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0236, 0xfa120000 / 4
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 3
    USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8218, 0xfa113000 / 6
    Model: MacBookPro6,2, BootROM MBP61.0057.B0F, 2 processors, Intel Core i7, 2.66 GHz, 4 GB, SMC 1.58f17
    Graphics: Intel HD Graphics, Intel HD Graphics, Built-In, 288 MB
    Graphics: NVIDIA GeForce GT 330M, NVIDIA GeForce GT 330M, PCIe, 512 MB
    Memory Module: BANK 0/DIMM0, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020
    Memory Module: BANK 1/DIMM0, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (5.106.98.100.17)
    Bluetooth: Version 4.1.7f4 12974, 3 service, 13 devices, 3 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: Hitachi HTS545050B9SA02, 500.11 GB
    Serial ATA Device: MATSHITADVD-R   UJ-898
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfd100000 / 2
    USB Device: Built-in iSight, apple_vendor_id, 0x8507, 0xfd110000 / 4
    USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd120000 / 3
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfa100000 / 2
    USB Device: Internal Memory Card Reader, apple_vendor_id, 0x8403, 0xfa130000 / 5
    USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0236, 0xfa120000 / 4
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 3
    USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8218, 0xfa113000 / 6
    Interval Since Last Panic Report:  33820 sec
    Panics Since Last Report:          3
    Anonymous UUID: FD0A243C-3325-3BE8-68B4-71E20A28CA75
    Thu Dec  5 11:25:48 2013
    panic(cpu 0 caller 0xffffff7f8dfcbf1a): "GPU Panic: [<None>] 5 3 7f 0 0 0 0 3 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xd2000000 0xffffff8088a1f000 0x0a5480a2, D0, P3/4\n"@/SourceCache/AppleGraphicsControl/AppleGraphicsControl-3.4.5/src/AppleM uxControl/kext/GPUPanic.cpp:127
    Backtrace (CPU 0), Frame : Return Address
    0xffffff80871c2ef0 : 0xffffff800c81d636
    0xffffff80871c2f60 : 0xffffff7f8dfcbf1a
    0xffffff80871c3030 : 0xffffff7f8e32b26c
    0xffffff80871c30f0 : 0xffffff7f8e3fe1f6
    0xffffff80871c3130 : 0xffffff7f8e3fe254
    0xffffff80871c31a0 : 0xffffff7f8e6b7278
    0xffffff80871c32d0 : 0xffffff7f8e426ad1
    0xffffff80871c32f0 : 0xffffff7f8e33203f
    0xffffff80871c33a0 : 0xffffff7f8e32fad6
    0xffffff80871c35a0 : 0xffffff7f8e3313ff
    0xffffff80871c3670 : 0xffffff7f8e87493e
    0xffffff80871c3730 : 0xffffff7f8e8a0028
    0xffffff80871c37b0 : 0xffffff7f8e887460
    0xffffff80871c3810 : 0xffffff7f8e887d41
    0xffffff80871c3860 : 0xffffff7f8e8881f3
    0xffffff80871c38d0 : 0xffffff7f8e888a53
    0xffffff80871c3910 : 0xffffff7f8e853edf
    0xffffff80871c3a90 : 0xffffff7f8e884f8f
    0xffffff80871c3b50 : 0xffffff7f8e852978
    0xffffff80871c3ba0 : 0xffffff800cc6f789
    0xffffff80871c3bc0 : 0xffffff800cc70d30
    0xffffff80871c3c20 : 0xffffff800cc6e74f
    0xffffff80871c3d70 : 0xffffff800c898c21
    0xffffff80871c3e80 : 0xffffff800c820b4d
    0xffffff80871c3eb0 : 0xffffff800c810448
    0xffffff80871c3f00 : 0xffffff800c81961b
    0xffffff80871c3f70 : 0xffffff800c8a6546
    0xffffff80871c3fb0 : 0xffffff800c8cf473
          Kernel Extensions in backtrace:
    com.apple.driver.AppleMuxControl(3.4.5)[4F710151-D347-301D-A0BA-81791B3E8D4D]@0 xffffff7f8dfbe000->0xffffff7f8dfd0fff
    dependency: com.apple.driver.AppleBacklightExpert(1.0.4)[B5B1F368-132E-3509-9ED5-93270E3ABB DD]@0xffffff7f8dfb9000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f8ce51000
    dependency: com.apple.driver.AppleGraphicsControl(3.4.5)[4A2C8548-7EF1-38A9-8817-E8CB34B8DC A6]@0xffffff7f8dfa5000
    dependency: com.apple.iokit.IOACPIFamily(1.4)[A35915E8-C1B0-3C0F-81DF-5515BC9002FC]@0xfffff f7f8d3a4000
                dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f8df93000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f8dc5d000
             com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f8e2 ca000->0xffffff7f8e56bfff
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f8ce51000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f8df93000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f8dc5d000
    com.apple.nvidia.nv50hal(8.1.6)[3455BCFE-565A-3FE5-9F0B-855BCB6CC9B3]@0xffffff7 f8e56c000->0xffffff7f8e83ffff
    dependency: com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f8e2 ca000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f8ce51000
    com.apple.GeForce(8.1.6)[7C67749B-3B6B-38A9-8203-01A139C21895]@0xffffff7f8e8400 00->0xffffff7f8e90dfff
    dependency: com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f8e2 ca000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f8df93000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f8ce51000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f8dc5d000
    BSD process name corresponding to current thread: WindowServer
    Mac OS version:
    12F45
    Kernel version:
    Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64
    Kernel UUID: EA38B02E-2B88-309F-BA68-1DE29F605DD8
    Kernel slide:     0x000000000c600000
    Kernel text base: 0xffffff800c800000
    System model name: MacBookPro6,2 (Mac-F22586C8)
    System uptime in nanoseconds: 1007163675937
    last loaded kext at 279670167764: com.apple.filesystems.msdosfs            1.8.1 (addr 0xffffff7f8e96d000, size 65536)
    loaded kexts:
    com.apple.filesystems.msdosfs            1.8.1
    com.apple.iokit.IOBluetoothSerialManager            4.1.7f4
    com.apple.driver.AudioAUUC            1.60
    com.apple.driver.AppleHWSensor            1.9.5d0
    com.apple.driver.AGPM            100.13.12
    com.apple.driver.AppleTyMCEDriver            1.0.2d2
    com.apple.iokit.IOUserEthernet            1.0.0d1
    com.apple.driver.AppleUpstreamUserClient            3.5.12
    com.apple.driver.AppleHDAHardwareConfigDriver            2.4.7fc4
    com.apple.driver.AppleMikeyHIDDriver            124
    com.apple.GeForce            8.1.6
    com.apple.driver.AppleIntelHDGraphics            8.1.6
    com.apple.iokit.IOBluetoothUSBDFU            4.1.7f4
    com.apple.driver.AppleHDA            2.4.7fc4
    com.apple.Dont_Steal_Mac_OS_X            7.0.0
    com.apple.driver.AppleMikeyDriver            2.4.7fc4
    com.apple.driver.AppleBacklight            170.3.5
    com.apple.driver.AppleSMCPDRC            1.0.0
    com.apple.iokit.AppleBCM5701Ethernet            3.6.2b4
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport            4.1.7f4
    com.apple.driver.AppleLPC            1.6.3
    com.apple.driver.AppleMuxControl            3.4.5
    com.apple.driver.AppleSMCLMU            2.0.3d0
    com.apple.driver.ApplePolicyControl            3.4.5
    com.apple.driver.AirPort.Brcm4331            615.20.17
    com.apple.driver.AppleIntelHDGraphicsFB            8.1.6
    com.apple.driver.AppleSMBusPCI            1.0.11d1
    com.apple.nvidia.NVDAStartup            8.1.6
    com.apple.driver.ACPI_SMC_PlatformPlugin            1.0.0
    com.apple.driver.SMCMotionSensor            3.0.3d1
    com.apple.driver.AppleMCCSControl            1.1.11
    com.apple.filesystems.autofs            3.0
    com.apple.driver.AppleUSBTCButtons            237.1
    com.apple.driver.AppleUSBTCKeyEventDriver            237.1
    com.apple.driver.AppleUSBTCKeyboard            237.1
    com.apple.driver.AppleFileSystemDriver            3.0.1
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless            1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib            1.0.0d1
    com.apple.BootCache            34
    com.apple.driver.AppleUSBCardReader            3.3.1
    com.apple.driver.AppleIRController            320.15
    com.apple.iokit.SCSITaskUserClient            3.5.6
    com.apple.driver.XsanFilter            404
    com.apple.iokit.IOAHCIBlockStorage            2.3.5
    com.apple.driver.AppleUSBHub            635.4.0
    com.apple.driver.AppleFWOHCI            4.9.9
    com.apple.driver.AppleAHCIPort            2.6.6
    com.apple.driver.AppleUSBUHCI            621.4.0
    com.apple.driver.AppleUSBEHCI            621.4.6
    com.apple.driver.AppleSmartBatteryManager            161.0.0
    com.apple.driver.AppleACPIButtons            1.8
    com.apple.driver.AppleRTC            1.5
    com.apple.driver.AppleHPET            1.8
    com.apple.driver.AppleSMBIOS            1.9
    com.apple.driver.AppleACPIEC            1.8
    com.apple.driver.AppleAPIC            1.7
    com.apple.driver.AppleIntelCPUPowerManagementClient            214.0.0
    com.apple.nke.applicationfirewall            4.0.39
    com.apple.security.quarantine            2.1
    com.apple.driver.AppleIntelCPUPowerManagement            214.0.0
    com.apple.iokit.IOSerialFamily            10.0.6
    com.apple.iokit.IOSurface            86.0.4
    com.apple.nvidia.nv50hal            8.1.6
    com.apple.NVDAResman            8.1.6
    com.apple.driver.DspFuncLib            2.4.7fc4
    com.apple.iokit.IOAudioFamily            1.9.2fc7
    com.apple.kext.OSvKernDSPLib            1.12
    com.apple.iokit.IOBluetoothFamily            4.1.7f4
    com.apple.iokit.IOEthernetAVBController            1.0.2b1
    com.apple.iokit.IOBluetoothHostControllerUSBTransport            4.1.7f4
    com.apple.iokit.IOFireWireIP            2.2.5
    com.apple.driver.AppleHDAController            2.4.7fc4
    com.apple.iokit.IOHDAFamily            2.4.7fc4
    com.apple.driver.AppleBacklightExpert            1.0.4
    com.apple.driver.AppleGraphicsControl            3.4.5
    com.apple.iokit.IONDRVSupport            2.3.7
    com.apple.iokit.IO80211Family            530.5
    com.apple.iokit.IONetworkingFamily            3.0
    com.apple.driver.IOPlatformPluginLegacy            1.0.0
    com.apple.driver.IOPlatformPluginFamily            5.4.1d13
    com.apple.driver.AppleSMC            3.1.5d4
    com.apple.driver.AppleSMBusController            1.0.11d1
    com.apple.iokit.IOGraphicsFamily            2.3.7
    com.apple.kext.triggers            1.0
    com.apple.driver.AppleUSBMultitouch            237.3
    com.apple.iokit.IOSCSIBlockCommandsDevice            3.5.6
    com.apple.iokit.IOUSBMassStorageClass            3.5.2
    com.apple.iokit.IOUSBHIDDriver            623.4.0
    com.apple.driver.AppleUSBMergeNub            621.4.6
    com.apple.driver.AppleUSBComposite            621.4.0
    com.apple.iokit.IOSCSIMultimediaCommandsDevice            3.5.6
    com.apple.iokit.IOBDStorageFamily            1.7
    com.apple.iokit.IODVDStorageFamily            1.7.1
    com.apple.iokit.IOCDStorageFamily            1.7.1
    com.apple.iokit.IOAHCISerialATAPI            2.5.5
    com.apple.iokit.IOSCSIArchitectureModelFamily            3.5.6
    com.apple.iokit.IOUSBUserClient            630.4.4
    com.apple.iokit.IOFireWireFamily            4.5.5
    com.apple.iokit.IOAHCIFamily            2.5.1
    com.apple.iokit.IOUSBFamily            635.4.0
    com.apple.driver.AppleEFINVRAM            2.0
    com.apple.driver.AppleEFIRuntime            2.0
    com.apple.iokit.IOHIDFamily            1.8.1
    com.apple.iokit.IOSMBusFamily            1.1
    com.apple.security.sandbox            220.3
    com.apple.kext.AppleMatch            1.0.0d1
    com.apple.security.TMSafetyNet            7
    com.apple.driver.DiskImages            345
    com.apple.iokit.IOStorageFamily            1.8
    com.apple.driver.AppleKeyStore            28.21
    com.apple.driver.AppleACPIPlatform            1.8
    com.apple.iokit.IOPCIFamily            2.8
    com.apple.iokit.IOACPIFamily            1.4
    com.apple.kec.corecrypto            1.0
    Interval Since Last Panic Report:  53866 sec
    Panics Since Last Report:          1
    Anonymous UUID: FD0A243C-3325-3BE8-68B4-71E20A28CA75
    Fri Jan 17 12:46:50 2014
    panic(cpu 2 caller 0xffffff7f8afc9f1a): "GPU Panic: [<None>] 5 3 7f 0 0 0 0 3 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xd2000000 0xffffff8085a5e000 0x0a5480a2, D0, P2/4\n"@/SourceCache/AppleGraphicsControl/AppleGraphicsControl-3.4.5/src/AppleM uxControl/kext/GPUPanic.cpp:127
    Backtrace (CPU 2), Frame : Return Address
    0xffffff80840035e0 : 0xffffff800981d636
    0xffffff8084003650 : 0xffffff7f8afc9f1a
    0xffffff8084003720 : 0xffffff7f8b32b26c
    0xffffff80840037e0 : 0xffffff7f8b3fe1f6
    0xffffff8084003820 : 0xffffff7f8b3fe254
    0xffffff8084003890 : 0xffffff7f8b6b7278
    0xffffff80840039c0 : 0xffffff7f8b426ad1
    0xffffff80840039e0 : 0xffffff7f8b33203f
    0xffffff8084003a90 : 0xffffff7f8b32fad6
    0xffffff8084003c90 : 0xffffff7f8b331bdc
    0xffffff8084003d80 : 0xffffff7f8b8a6c6f
    0xffffff8084003de0 : 0xffffff7f8b8a3f07
    0xffffff8084003e20 : 0xffffff7f8b88d898
    0xffffff8084003e60 : 0xffffff7f8b86949e
    0xffffff8084003e80 : 0xffffff7f8b84a130
    0xffffff8084003ed0 : 0xffffff7f8b8474ab
    0xffffff8084003ef0 : 0xffffff8009c50e58
    0xffffff8084003f30 : 0xffffff8009c4f95a
    0xffffff8084003f80 : 0xffffff8009c4fa89
    0xffffff8084003fb0 : 0xffffff80098b3257
          Kernel Extensions in backtrace:
    com.apple.driver.AppleMuxControl(3.4.5)[4F710151-D347-301D-A0BA-81791B3E8D4D]@0 xffffff7f8afbc000->0xffffff7f8afcefff
    dependency: com.apple.driver.AppleBacklightExpert(1.0.4)[B5B1F368-132E-3509-9ED5-93270E3ABB DD]@0xffffff7f8afb7000
                dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f89e51000
    dependency: com.apple.driver.AppleGraphicsControl(3.4.5)[4A2C8548-7EF1-38A9-8817-E8CB34B8DC A6]@0xffffff7f8ad17000
    dependency: com.apple.iokit.IOACPIFamily(1.4)[A35915E8-C1B0-3C0F-81DF-5515BC9002FC]@0xfffff f7f8a3a4000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f8ad05000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f8ac72000
    com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f8b2 ca000->0xffffff7f8b56bfff
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f89e51000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f8ad05000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f8ac72000
    com.apple.nvidia.nv50hal(8.1.6)[3455BCFE-565A-3FE5-9F0B-855BCB6CC9B3]@0xffffff7 f8b56c000->0xffffff7f8b83ffff
    dependency: com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f8b2 ca000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f89e51000
    com.apple.GeForce(8.1.6)[7C67749B-3B6B-38A9-8203-01A139C21895]@0xffffff7f8b8400 00->0xffffff7f8b90dfff
                dependency: com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f8b2 ca000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f8ad05000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f89e51000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f8ac72000
    BSD process name corresponding to current thread: kernel_task
    Mac OS version:
    12F45
    Kernel version:
    Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64
    Kernel UUID: EA38B02E-2B88-309F-BA68-1DE29F605DD8
    Kernel slide:     0x0000000009600000
    Kernel text base: 0xffffff8009800000
    System model name: MacBookPro6,2 (Mac-F22586C8)
    System uptime in nanoseconds: 1296160322184
    last loaded kext at 290987910621: com.apple.filesystems.msdosfs            1.8.1 (addr 0xffffff7f8b96d000, size 65536)
    loaded kexts:
    com.apple.filesystems.msdosfs            1.8.1
    com.apple.driver.AudioAUUC            1.60
    com.apple.driver.AppleHWSensor            1.9.5d0
    com.apple.iokit.IOUserEthernet            1.0.0d1
    com.apple.driver.AGPM            100.13.12
    com.apple.driver.AppleTyMCEDriver            1.0.2d2
    com.apple.iokit.IOBluetoothSerialManager            4.1.7f4
    com.apple.driver.AppleUpstreamUserClient            3.5.12
    com.apple.driver.AppleHDAHardwareConfigDriver            2.4.7fc4
    com.apple.driver.AppleMikeyHIDDriver            124
    com.apple.GeForce            8.1.6
    com.apple.driver.AppleIntelHDGraphics            8.1.6
    com.apple.iokit.IOBluetoothUSBDFU            4.1.7f4
    com.apple.driver.AppleHDA            2.4.7fc4
    com.apple.driver.AppleMikeyDriver            2.4.7fc4
    com.apple.Dont_Steal_Mac_OS_X            7.0.0
    com.apple.driver.AppleBacklight            170.3.5
    com.apple.iokit.AppleBCM5701Ethernet            3.6.2b4
    com.apple.driver.AppleSMCPDRC            1.0.0
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport            4.1.7f4
    com.apple.driver.AppleSMCLMU            2.0.3d0
    com.apple.driver.AppleMuxControl            3.4.5
    com.apple.driver.AppleSMBusPCI            1.0.11d1
    com.apple.driver.AppleLPC            1.6.3
    com.apple.driver.AirPort.Brcm4331            615.20.17
    com.apple.driver.ApplePolicyControl            3.4.5
    com.apple.driver.AppleIntelHDGraphicsFB            8.1.6
    com.apple.nvidia.NVDAStartup            8.1.6
    com.apple.driver.ACPI_SMC_PlatformPlugin            1.0.0
    com.apple.driver.AppleMCCSControl            1.1.11
    com.apple.driver.SMCMotionSensor            3.0.3d1
    com.apple.filesystems.autofs            3.0
    com.apple.driver.AppleUSBTCButtons            237.1
    com.apple.driver.AppleUSBTCKeyEventDriver            237.1
    com.apple.driver.AppleUSBTCKeyboard            237.1
    com.apple.driver.AppleUSBCardReader            3.3.1
    com.apple.driver.AppleIRController            320.15
    com.apple.driver.AppleFileSystemDriver            3.0.1
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless            1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib            1.0.0d1
    com.apple.BootCache            34
    com.apple.iokit.SCSITaskUserClient            3.5.6
    com.apple.driver.XsanFilter            404
    com.apple.iokit.IOAHCIBlockStorage            2.3.5
    com.apple.driver.AppleAHCIPort            2.6.6
    com.apple.driver.AppleUSBHub            635.4.0
    com.apple.driver.AppleFWOHCI            4.9.9
    com.apple.driver.AppleUSBEHCI            621.4.6
    com.apple.driver.AppleUSBUHCI            621.4.0
    com.apple.driver.AppleSmartBatteryManager            161.0.0
    com.apple.driver.AppleACPIButtons            1.8
    com.apple.driver.AppleRTC            1.5
    com.apple.driver.AppleHPET            1.8
    com.apple.driver.AppleSMBIOS            1.9
    com.apple.driver.AppleACPIEC            1.8
    com.apple.driver.AppleAPIC            1.7
    com.apple.driver.AppleIntelCPUPowerManagementClient            214.0.0
    com.apple.nke.applicationfirewall            4.0.39
    com.apple.security.quarantine            2.1
    com.apple.driver.AppleIntelCPUPowerManagement            214.0.0
    com.apple.iokit.IOSerialFamily            10.0.6
    com.apple.iokit.IOSurface            86.0.4
    com.apple.nvidia.nv50hal            8.1.6
    com.apple.NVDAResman            8.1.6
    com.apple.driver.DspFuncLib            2.4.7fc4
    com.apple.iokit.IOAudioFamily            1.9.2fc7
    com.apple.kext.OSvKernDSPLib            1.12
    com.apple.iokit.IOBluetoothFamily            4.1.7f4
    com.apple.iokit.IOEthernetAVBController            1.0.2b1
    com.apple.iokit.IOBluetoothHostControllerUSBTransport            4.1.7f4
    com.apple.iokit.IOFireWireIP            2.2.5
    com.apple.driver.AppleHDAController            2.4.7fc4
    com.apple.iokit.IOHDAFamily            2.4.7fc4
    com.apple.driver.AppleBacklightExpert            1.0.4
    com.apple.iokit.IO80211Family            530.5
    com.apple.iokit.IONetworkingFamily            3.0
    com.apple.driver.AppleGraphicsControl            3.4.5
    com.apple.iokit.IONDRVSupport            2.3.7
    com.apple.driver.IOPlatformPluginLegacy            1.0.0
    com.apple.driver.IOPlatformPluginFamily            5.4.1d13
    com.apple.driver.AppleSMBusController            1.0.11d1
    com.apple.iokit.IOGraphicsFamily            2.3.7
    com.apple.driver.AppleSMC            3.1.5d4
    com.apple.kext.triggers            1.0
    com.apple.driver.AppleUSBMultitouch            237.3
    com.apple.iokit.IOSCSIBlockCommandsDevice            3.5.6
    com.apple.iokit.IOUSBMassStorageClass            3.5.2
    com.apple.iokit.IOUSBHIDDriver            623.4.0
    com.apple.driver.AppleUSBMergeNub            621.4.6
    com.apple.driver.AppleUSBComposite            621.4.0
    com.apple.iokit.IOSCSIMultimediaCommandsDevice            3.5.6
    com.apple.iokit.IOBDStorageFamily            1.7
    com.apple.iokit.IODVDStorageFamily            1.7.1
    com.apple.iokit.IOCDStorageFamily            1.7.1
    com.apple.iokit.IOAHCISerialATAPI            2.5.5
    com.apple.iokit.IOSCSIArchitectureModelFamily            3.5.6
    com.apple.iokit.IOAHCIFamily            2.5.1
    com.apple.iokit.IOFireWireFamily            4.5.5
    com.apple.iokit.IOUSBUserClient            630.4.4
    com.apple.iokit.IOUSBFamily            635.4.0
    com.apple.driver.AppleEFINVRAM            2.0
    com.apple.driver.AppleEFIRuntime            2.0
    com.apple.iokit.IOHIDFamily            1.8.1
    com.apple.iokit.IOSMBusFamily            1.1
    com.apple.security.sandbox            220.3
    com.apple.kext.AppleMatch            1.0.0d1
    com.apple.security.TMSafetyNet            7
    com.apple.driver.DiskImages            345
    com.apple.iokit.IOStorageFamily            1.8
    com.apple.driver.AppleKeyStore            28.21
    com.apple.driver.AppleACPIPlatform            1.8
    com.apple.iokit.IOPCIFamily            2.8
    com.apple.iokit.IOACPIFamily            1.4
    com.apple.kec.corecrypto            1.0
    Interval Since Last Panic Report:  834 sec
    Panics Since Last Report:          1
    Anonymous UUID: FD0A243C-3325-3BE8-68B4-71E20A28CA75
    Anonymous UUID: FD0A243C-3325-3BE8-68B4-71E20A28CA75
    Fri Jan 17 12:53:39 2014
    panic(cpu 1 caller 0xffffff7f9093bf1a): "GPU Panic: [<None>] 5 3 7f 0 0 0 0 3 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xd2000000 0xffffff808b672000 0x0a5480a2, D0, P2/4\n"@/SourceCache/AppleGraphicsControl/AppleGraphicsControl-3.4.5/src/AppleM uxControl/kext/GPUPanic.cpp:127
    Backtrace (CPU 1), Frame : Return Address
    0xffffff808a722ef0 : 0xffffff800f41d636
    0xffffff808a722f60 : 0xffffff7f9093bf1a
    0xffffff808a723030 : 0xffffff7f90f2b26c
    0xffffff808a7230f0 : 0xffffff7f90ffe1f6
    0xffffff808a723130 : 0xffffff7f90ffe254
    0xffffff808a7231a0 : 0xffffff7f912b7278
    0xffffff808a7232d0 : 0xffffff7f91026ad1
    0xffffff808a7232f0 : 0xffffff7f90f3203f
    0xffffff808a7233a0 : 0xffffff7f90f2fad6
    0xffffff808a7235a0 : 0xffffff7f90f313ff
    0xffffff808a723670 : 0xffffff7f9147493e
    0xffffff808a723730 : 0xffffff7f914a0028
    0xffffff808a7237b0 : 0xffffff7f91487460
    0xffffff808a723810 : 0xffffff7f91487d41
    0xffffff808a723860 : 0xffffff7f914881f3
    0xffffff808a7238d0 : 0xffffff7f91488a53
    0xffffff808a723910 : 0xffffff7f91453edf
    0xffffff808a723a90 : 0xffffff7f91484f8f
    0xffffff808a723b50 : 0xffffff7f91452978
    0xffffff808a723ba0 : 0xffffff800f86f789
    0xffffff808a723bc0 : 0xffffff800f870d30
    0xffffff808a723c20 : 0xffffff800f86e74f
    0xffffff808a723d70 : 0xffffff800f498c21
    0xffffff808a723e80 : 0xffffff800f420b4d
    0xffffff808a723eb0 : 0xffffff800f410448
    0xffffff808a723f00 : 0xffffff800f41961b
    0xffffff808a723f70 : 0xffffff800f4a6546
    0xffffff808a723fb0 : 0xffffff800f4cf473
          Kernel Extensions in backtrace:
    com.apple.driver.AppleMuxControl(3.4.5)[4F710151-D347-301D-A0BA-81791B3E8D4D]@0 xffffff7f9092e000->0xffffff7f90940fff
    dependency: com.apple.driver.AppleBacklightExpert(1.0.4)[B5B1F368-132E-3509-9ED5-93270E3ABB DD]@0xffffff7f90929000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f8fa51000
    dependency: com.apple.driver.AppleGraphicsControl(3.4.5)[4A2C8548-7EF1-38A9-8817-E8CB34B8DC A6]@0xffffff7f9091a000
                dependency: com.apple.iokit.IOACPIFamily(1.4)[A35915E8-C1B0-3C0F-81DF-5515BC9002FC]@0xfffff f7f8ffa4000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f90908000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f90875000
    com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f90e ca000->0xffffff7f9116bfff
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f8fa51000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f90908000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f90875000
    com.apple.nvidia.nv50hal(8.1.6)[3455BCFE-565A-3FE5-9F0B-855BCB6CC9B3]@0xffffff7 f9116c000->0xffffff7f9143ffff
    dependency: com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f90e ca000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f8fa51000
    com.apple.GeForce(8.1.6)[7C67749B-3B6B-38A9-8203-01A139C21895]@0xffffff7f914400 00->0xffffff7f9150dfff
    dependency: com.apple.NVDAResman(8.1.6)[EA4F9902-5AAE-3F1D-A846-3796221C8C91]@0xffffff7f90e ca000
    dependency: com.apple.iokit.IONDRVSupport(2.3.7)[F16E015E-1ABE-3C40-AC71-BC54F4BE442E]@0xff ffff7f90908000
    dependency: com.apple.iokit.IOPCIFamily(2.8)[6C1D646D-7E5E-3D7F-A557-2CBA398FF878]@0xffffff 7f8fa51000
    dependency: com.apple.iokit.IOGraphicsFamily(2.3.7)[9928306E-3508-3DBC-80A4-D8F1D87650D7]@0 xffffff7f90875000
    BSD process name corresponding to current thread: WindowServer
    Mac OS version:
    12F45
    Kernel version:
    Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64
    Kernel UUID: EA38B02E-2B88-309F-BA68-1DE29F605DD8
    Kernel slide:     0x000000000f200000
    Kernel text base: 0xffffff800f400000
    System model name: MacBookPro6,2 (Mac-F22586C8)
    System uptime in nanoseconds: 398323526048
    last loaded kext at 277486843663: com.apple.filesystems.msdosfs            1.8.1 (addr 0xffffff7f9156d000, size 65536)
    loaded kexts:
    com.apple.filesystems.msdosfs            1.8.1
    com.apple.iokit.IOBluetoothSerialManager            4.1.7f4
    com.apple.driver.AudioAUUC            1.60
    com.apple.driver.AppleHWSensor            1.9.5d0
    com.apple.driver.AGPM            100.13.12
    com.apple.driver.AppleTyMCEDriver            1.0.2d2
    com.apple.iokit.IOUserEthernet            1.0.0d1
    com.apple.driver.AppleUpstreamUserClient            3.5.12
    com.apple.driver.AppleHDAHardwareConfigDriver            2.4.7fc4
    com.apple.driver.AppleMikeyHIDDriver            124
    com.apple.GeForce            8.1.6
    com.apple.driver.AppleIntelHDGraphics            8.1.6
    com.apple.iokit.IOBluetoothUSBDFU            4.1.7f4
    com.apple.driver.AppleHDA            2.4.7fc4
    com.apple.driver.AppleMikeyDriver            2.4.7fc4
    com.apple.Dont_Steal_Mac_OS_X            7.0.0
    com.apple.driver.AppleBacklight            170.3.5
    com.apple.driver.AppleSMCPDRC            1.0.0
    com.apple.iokit.AppleBCM5701Ethernet            3.6.2b4
    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport            4.1.7f4
    com.apple.driver.AppleSMCLMU            2.0.3d0
    com.apple.driver.AirPort.Brcm4331            615.20.17
    com.apple.driver.AppleSMBusPCI            1.0.11d1
    com.apple.driver.AppleMuxControl            3.4.5
    com.apple.driver.ApplePolicyControl            3.4.5
    com.apple.driver.AppleLPC            1.6.3
    com.apple.driver.ACPI_SMC_PlatformPlugin            1.0.0
    com.apple.driver.AppleMCCSControl            1.1.11
    com.apple.driver.AppleIntelHDGraphicsFB            8.1.6
    com.apple.nvidia.NVDAStartup            8.1.6
    com.apple.driver.SMCMotionSensor            3.0.3d1
    com.apple.filesystems.autofs            3.0
    com.apple.driver.AppleUSBTCButtons            237.1
    com.apple.driver.AppleUSBCardReader            3.3.1
    com.apple.driver.AppleUSBTCKeyEventDriver            237.1
    com.apple.driver.AppleUSBTCKeyboard            237.1
    com.apple.driver.AppleIRController            320.15
    com.apple.driver.AppleFileSystemDriver            3.0.1
    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless            1.0.0d1
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib            1.0.0d1
    com.apple.BootCache            34
    com.apple.iokit.SCSITaskUserClient            3.5.6
    com.apple.driver.XsanFilter            404
    com.apple.iokit.IOAHCIBlockStorage            2.3.5
    com.apple.driver.AppleFWOHCI            4.9.9
    com.apple.driver.AppleUSBHub            635.4.0
    com.apple.driver.AppleAHCIPort            2.6.6
    com.apple.driver.AppleUSBEHCI            621.4.6
    com.apple.driver.AppleUSBUHCI            621.4.0
    com.apple.driver.AppleSmartBatteryManager            161.0.0
    com.apple.driver.AppleACPIButtons            1.8
    com.apple.driver.AppleRTC            1.5
    com.apple.driver.AppleHPET            1.8
    com.apple.driver.AppleSMBIOS            1.9
    com.apple.driver.AppleACPIEC            1.8
    com.apple.driver.AppleAPIC            1.7
    com.apple.driver.AppleIntelCPUPowerManagementClient            214.0.0
    com.apple.nke.applicationfirewall            4.0.39
    com.apple.security.quarantine            2.1
    com.apple.driver.AppleIntelCPUPowerManagement            214.0.0
    com.apple.iokit.IOSerialFamily            10.0.6
    com.apple.iokit.IOSurface            86.0.4
    com.apple.nvidia.nv50hal            8.1.6
    com.apple.NVDAResman            8.1.6
    com.apple.driver.DspFuncLib            2.4.7fc4
    com.apple.iokit.IOAudioFamily            1.9.2fc7
    com.apple.kext.OSvKernDSPLib            1.12
    com.apple.iokit.IOBluetoothFamily            4.1.7f4
    com.apple.iokit.IOEthernetAVBController            1.0.2b1
    com.apple.iokit.IOBluetoothHostControllerUSBTransport            4.1.7f4
    com.apple.iokit.IOFireWireIP            2.2.5
    com.apple.driver.AppleHDAController            2.4.7fc4
    com.apple.iokit.IOHDAFamily            2.4.7fc4
    com.apple.iokit.IO80211Family            530.5
    com.apple.iokit.IONetworkingFamily            3.0
    com.apple.driver.AppleBacklightExpert            1.0.4
    com.apple.driver.AppleGraphicsControl            3.4.5
    com.apple.iokit.IONDRVSupport            2.3.7
    com.apple.driver.IOPlatformPluginLegacy            1.0.0
    com.apple.driver.IOPlatformPluginFamily            5.4.1d13
    com.apple.driver.AppleSMBusController            1.0.11d1
    com.apple.iokit.IOGraphicsFamily            2.3.7
    com.apple.driver.AppleSMC            3.1.5d4
    com.apple.kext.triggers            1.0
    com.apple.iokit.IOSCSIBlockCommandsDevice            3.5.6
    com.apple.iokit.IOUSBMassStorageClass            3.5.2
    com.apple.driver.AppleUSBMultitouch            237.3
    com.apple.iokit.IOUSBHIDDriver            623.4.0
    com.apple.driver.AppleUSBMergeNub            621.4.6
    com.apple.driver.AppleUSBComposite            621.4.0
    com.apple.iokit.IOSCSIMultimediaCommandsDevice            3.5.6
    com.apple.iokit.IOBDStorageFamily            1.7
    com.apple.iokit.IODVDStorageFamily            1.7.1
    com.apple.iokit.IOCDStorageFamily            1.7.1
    com.apple.iokit.IOAHCISerialATAPI            2.5.5
    com.apple.iokit.IOSCSIArchitectureModelFamily            3.5.6
    com.apple.iokit.IOFireWireFamily            4.5.5
    com.apple.iokit.IOUSBUserClient            630.4.4
    com.apple.iokit.IOAHCIFamily            2.5.1
    com.apple.iokit.IOUSBFamily            635.4.0
    com.apple.driver.AppleEFINVRAM            2.0
    com.apple.driver.AppleEFIRuntime            2.0
    com.apple.iokit.IOHIDFamily            1.8.1
    com.apple.iokit.IOSMBusFamily            1.1
    com.apple.security.sandbox            220.3
    com.apple.kext.AppleMatch            1.0.0d1
    com.apple.security.TMSafetyNet            7
    com.apple.driver.DiskImages            345
    com.apple.iokit.IOStorageFamily            1.8
    com.apple.driver.AppleKeyStore            28.21
    com.apple.driver.AppleACPIPlatform            1.8
    com.apple.iokit.IOPCIFamily            2.8
    com.apple.iokit.IOACPIFamily            1.4
    com.apple.kec.corecrypto            1.0
    System Profile:
    Model: MacBookPro6,2, BootROM MBP61.0057.B0F, 2 processors, Intel Core i7, 2.66 GHz, 4 GB, SMC 1.58f17
    Graphics: Intel HD Graphics, Intel HD Graphics, Built-In, 288 MB
    Graphics: NVIDIA GeForce GT 330M, NVIDIA GeForce GT 330M, PCIe, 512 MB
    Memory Module: BANK 0/DIMM0, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020
    Memory Module: BANK 1/DIMM0, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (5.106.98.100.17)
    Bluetooth: Version 4.1.7f4 12974, 3 service, 13 devices, 3 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: Hitachi HTS545050B9SA02, 500.11 GB
    Serial ATA Device: MATSHITADVD-R   UJ-898
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfa100000 / 2
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 5
    USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8218, 0xfa113000 / 8
    USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0236, 0xfa120000 / 4
    USB Device: Internal Memory Card Reader, apple_vendor_id, 0x8403, 0xfa130000 / 3
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfd100000 / 2
    USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd120000 / 4
    USB Device: Built-in iSight, apple_vendor_id, 0x8507, 0xfd110000 / 3
    Model: MacBookPro6,2, BootROM MBP61.0057.B0F, 2 processors, Intel Core i7, 2.66 GHz, 4 GB, SMC 1.58f17
    Graphics: Intel HD Graphics, Intel HD Graphics, Built-In, 288 MB
    Graphics: NVIDIA GeForce GT 330M, NVIDIA GeForce GT 330M, PCIe, 512 MB
    Memory Module: BANK 0/DIMM0, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020
    Memory Module: BANK 1/DIMM0, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (5.106.98.100.17)
    Bluetooth: Version 4.1.7f4 12974, 3 service, 13 devices, 3 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: Hitachi HTS545050B9SA02, 500.11 GB
    Serial ATA Device: MATSHITADVD-R   UJ-898
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfa100000 / 2
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 5
    USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8218, 0xfa113000 / 8
    USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0236, 0xfa120000 / 4
    USB Device: Internal Memory Card Reader, apple_vendor_id, 0x8403, 0xfa130000 / 3
    USB Device: hub_device, 0x0424  (SMSC), 0x2514, 0xfd100000 / 2
    USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd120000 / 4
    USB Device: Built-in iSight, apple_vendor_id, 0x8507, 0xfd110000 / 3

    Welcome to Apple Support Communities
    You have got a Mid 2010 15-inch MacBook Pro and the log shows that the NVIDIA GPU is damaged.
    These MacBooks Pro have got a defective GPU that may cause unexpected restarts, black screens, kernel panics, etc. See > http://support.apple.com/kb/TS4088
    Apple is repairing all these MacBooks for free if they were purchased less than 3 years ago, so make a backup of your files onto an external drive with Time Machine and take the computer to an Apple Store or reseller.

  • Sorry, here's the code for 2 solution in writing a pdf to file

    //First solution
    String outfile = "D:\\At Work\\Tags\\Release 3.7\\2476\\output.pdf";
    PdfReader r1 = new PdfReader("D:\\At Work\\Tags\\Release 3.7\\2476\\textfield.pdf");
    PdfStamper stamper = new PdfStamper(r1,new FileOutputStream(outfile));
    stamper.close();
    //Second Solution
    String outfile = "D:\\At Work\\Tags\\Release 3.7\\2476\\output.pdf";
    PdfReader r = new PdfReader("D:\\At Work\\Tags\\Release 3.7\\2476\\textfield.pdf");
    PdfCopyFields copy = new PdfCopyFields(new FileOutputStream(outfile));
    copy.addDocument(this);
    copy.close();

    Please use reply, not post new threads.

  • Have just downloaded and installed IO5.....lost all my apps!! and now the ipad only works with a badly lit screen....anyune else come across this one??

    Have just downloaded IO5......lost all my apps in the process and now only get a very poorly lit screen. Any ideas out there??

    The brightness issue is not something that I've heard of in connection to the update, it may just be a coincidence. Has the brightness level in Settings > Brightness & Wallpaper been turned for some reason ? If not then you could try a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear (it won't remove any content that you've got on the iPad, it's the iPad equivalent of a reboot). But it could be a hardware issue so you may need to contact Apple.
    In terms of your apps, were they on your computer's iTunes when you did the update ? The iPad backup only contains the content and settings from you apps and not the actual apps, so for the restore to work fully you need your apps on your computer's iTunes. As long as the apps are still available in the store, and you use the same iTunes account as you originally used to buy them, then you should be able to re-download them for free - if you re-download them to your computer you could then try restoring to your backup and see if that restores then and their content.

  • A question on JInternalFrame of Swing. Let see the code

    Hello everybody,
    I am setting up a Frame that contains 2 JInternalFrames in its desktopPane. The first JInternalFrame is to show the map. The second one have some check box. What I wanna do is, when I check the CheckBox in the second JInternalFrame, after getting the result from Database, it show the result on Map. The result will be some red ellipses on the first JInternalFrame.
    The code work well with Database. But I really need your help to do with the event on InternalFrame
    Thanks in advance !
    Quin,
    Here is the code of the main Frame:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    import java.beans.*;
    public class MapLocator
         public static void main(String [] args)
              JFrame frame = new DesktopFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
    Create a desktop frames that contains internal frame
    class DesktopFrame extends JFrame implements ActionListener
         public DesktopFrame()
              super("Map Locator v.1.0.0");
              this.setSize(new Dimension(WIDTH,HEIGHT));
              desktop = new JDesktopPane();
              this.setContentPane(desktop);
              this.createInternalFrame(
                   new mapPanel(),"Ban do Thanh pho Ho Chi Minh",0,0,480,515);
              this.createInternalFrame(
                   new commandPanel(),"Chu thich va tim kiem",480,0,320,515);
    Create an internal frame on the desktop.
    @param c the component to display in the internal frame
    @param t the title ofthe internal frame.
         public void createInternalFrame(JPanel c, String t,int ifx, int ify, int ifwidth, int ifheight)
                 final JInternalFrame iframe = new JInternalFrame(t,
                 true//resizeable
                 ,true//closable
                 ,true//maximizable
                 ,true//iconifiable
                 iframe.getContentPane().add(c);
                 desktop.add(iframe);
                 iframe.setFrameIcon(new ImageIcon("new.gif"));
                 //add listener to confirm frame closing
                 iframe.addVetoableChangeListener(new VetoableChangeListener()
                      public void vetoableChange(PropertyChangeEvent event)
                           throws PropertyVetoException
                           String name = event.getPropertyName();
                           Object value = event.getNewValue();
                           //we only want to check attempts to close a frame
                           if(name.equals("closed") && value.equals(Boolean.TRUE))
                                //ask user if it is ok to close
                                int result =
                      JOptionPane.showInternalConfirmDialog(iframe,"OK to close");
                                //if the user doesn't agree, veto the close
                                if(result != JOptionPane.YES_OPTION)
                      throw new PropertyVetoException("User cancel the close",event);
                 iframe.setVisible(true);
                 iframe.setLocation(ifx,ify);
                 iframe.setSize(new Dimension (ifwidth, ifheight));
         private static final int WIDTH = 800;
         private static final int HEIGHT = 600;
         private JDesktopPane desktop;
         private int nextFrameX;
           private int nextFrameY;
            private int frameDistance;
         private JMenuBar menuBar;
         private JMenu fileMenu, viewMenu, searchMenu, windowMenu, helpMenu;
         private JRadioButtonMenuItem javalaf, liquidlaf, motiflaf, windowlaf, threedlaf;
    }Below is the code of first JInternalFrame
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.util.Random;
    import java.util.*;
    import com.sun.image.codec.jpeg.*;
    Create a canvas that show a map
    public class mapPanel extends JPanel
         implements MouseMotionListener, MouseListener
         public mapPanel()
              addMouseMotionListener(this);
              addMouseListener(this);
    Unbarrier the comment below to see how the map model work
    //Unbarrier this to see -->
             try
                InputStream in = getClass().getResourceAsStream(nameOfMap);
                JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(in);
                mImage = decoder.decodeAsBufferedImage();
                in.close();//Close dong nhap
              catch(ImageFormatException ie)
              { System.out.println ("Error on formating image");}
              catch(IOException ioe)
              { System.out.println ("Error on input/ouput image");}
              catch(Exception e){}
    Connect to database
              connDB();
              String addQuery = "";
              try
              Get the relation amongs points
                   int idStart = 0;
                   int idEnd = 0;
                   addQuery ="SELECT IDStart, IDEnd FROM 2Diem";
                   rs = stmt.executeQuery(addQuery);
                   int incre = 0;
                   while(rs.next())
                        idStart = rs.getInt(1);
                        Rel.add(incre, new Integer(idStart));
                        incre ++;
                        idEnd = rs.getInt(2);
                        Rel.add(incre, new Integer(idEnd));
                        incre ++;
         Load the Coordination of the points to hash table
                   int idPoint = 0;
                   int XP = 0;
                   int YP = 0;
                   addQuery ="SELECT IDDiem, CoorX, CoorY FROM Diem";
                   rs = stmt.executeQuery(addQuery);     
                   while(rs.next())
                        idPoint = rs.getInt(1);
                        XP = rs.getInt(2);
                        YP = rs.getInt(3);
                        hashX.put(new Integer(idPoint), new Integer(XP));
                        hashY.put(new Integer(idPoint), new Integer(YP));
         Create Points to draw the Line
                   line = new Line2D[(Rel.size())/2];
                   for(int i = 0, k = 0; i < Rel.size();i++, k = k+2)
                        X1 = Integer.parseInt(""+hashX.get(Rel.elementAt(i)));
                        Y1 = Integer.parseInt(""+hashY.get(Rel.elementAt(i)));
                        i++;
                        X2 = Integer.parseInt(""+hashX.get(Rel.elementAt(i)));
                        Y2 = Integer.parseInt(""+hashY.get(Rel.elementAt(i)));
                        line[k/2] = new Line2D.Double(X1,Y1,X2,Y2);
              catch(SQLException sqle){}
         private Hashtable hashX = new Hashtable();
         private Hashtable hashY = new Hashtable();
         private Vector Rel = new Vector(100,10);
         private Vector vecBackX = new Vector(10,2);
         private Vector vecBackY = new Vector(10,2);
         private int X1 = 0, X2 = 0, Y1 = 0, Y2 = 0;
         Draw the image to show
         public void paintComponent(Graphics g)
              super.paintComponent(g);
              Graphics2D g2 = (Graphics2D) g;
              g2.setRenderingHint(
                   RenderingHints.KEY_ANTIALIASING,
                   RenderingHints.VALUE_ANTIALIAS_ON);
        //     g2.drawImage(mImage,0,0,null);
        Paint the background with light Gray
              g2.setPaint(Color.lightGray);
              g2.fill(new Rectangle2D.Double(0,0,480,480));          
             fillBack(g2);
        Draw the street with its border is white, its background is orange
             g2.setPaint(Color.white);
              g2.setStroke(new BasicStroke(14,BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
              for(int k = 0; k < Rel.size()/2; k++)
                   g2.draw(line[k]);
              g2.setPaint(Color.orange);
              g2.setStroke(new BasicStroke(10,BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
              for(int k = 0; k < Rel.size()/2; k++)
                   g2.draw(line[k]);
         Draw the grid on map
              g2.setPaint(Color.white);
              g2.setStroke(new BasicStroke(1));
              drawGrid(g2);
              if(point != null)
                   g2.setPaint(Color.red);
                   g2.fillOval(point.x - 3, point.y - 3, 7, 7);
    Draw the Background with tree and water
    @param g2 the Graphics2D that used to draw shapes
         private void fillBack(Graphics2D g2)
              Draw the background for map
              try
                   int BackX = 0;
                   int BackY = 0;
                   int incre = 0;
                   backGround = new GeneralPath[3];
                   for(int idBack = 1; idBack <= 3; idBack++)
    Since we use the vector for each background(tree / water), we have to
    refresh the vector before it can add new path inside
                        vecBackX.clear();
                        vecBackY.clear();
                        String addQuery = "SELECT CoorX, CoorY FROM BackCoor WHERE "
                        + " IDBack =" + idBack;
                        rs = stmt.executeQuery(addQuery);
                        while(rs.next())
                             BackX = rs.getInt(1);
                             BackY = rs.getInt(2);
    This will take the point into vector
                             vecBackX.add(incre,new Integer(BackX));
                             vecBackY.add(incre,new Integer(BackY));
                             incre++;
    Design the shapes of path
                             backGround[(idBack - 1)] =
                                  new GeneralPath(GeneralPath.WIND_EVEN_ODD);
                             backGround[(idBack - 1)].moveTo(
                                  Integer.parseInt(""+vecBackX.elementAt(0)),
                                  Integer.parseInt(""+vecBackY.elementAt(0)));
                             for(int i = 1; i < vecBackX.size(); i++)
                                  backGround[(idBack - 1)].lineTo(
                                       Integer.parseInt(""+vecBackX.elementAt(i)),
                                       Integer.parseInt(""+vecBackY.elementAt(i)));
                             backGround[(idBack - 1)].lineTo(
                                       Integer.parseInt(""+vecBackX.elementAt(0)),
                                       Integer.parseInt(""+vecBackY.elementAt(0)));
                             backGround[(idBack - 1)].closePath();
    Here we have 3 Path that represented to tree and water
    The first and second one is tree.
    The last one is water.
    Draw the path now
                             if(idBack == 3)
                                  g2.setPaint(Color.cyan);
                                  g2.fill(backGround[(idBack - 1)]);
                             else
                                  g2.setPaint(Color.green);
                                  g2.fill(backGround[(idBack - 1)]);
                             incre = 0;
              catch(SQLException sqle)
                   System.out.println ("Khong ve duoc back ground");
    Create the grid on map
    @param g2 the Graphics2D that used to draw shapes
         private void drawGrid(Graphics2D g2)
              try
                 String Query =
                 "SELECT * FROM Grid";
                 rs = stmt.executeQuery(Query);
                 GridX = new Vector(100,2);
                 GridY = new Vector(100,2);
                 GridW = new Vector(100,2);
                 GridH = new Vector(100,2);
                 int incr = 0;
                 while(rs.next())
                      gridX = rs.getInt(2);
                      gridY = rs.getInt(3);
                      gridW = rs.getInt(4);
                      gridH = rs.getInt(5);
                      GridX.add(incr, new Integer(gridX));
                      GridY.add(incr, new Integer(gridY));
                      GridW.add(incr, new Integer(gridW));
                      GridH.add(incr, new Integer(gridH));
                      incr ++;
                 rec = new Rectangle2D.Double[GridX.size()];
                 for(int i = 0; i < GridX.size(); i++)
                      gridX = Integer.parseInt(""+GridX.elementAt(i));
                      gridY = Integer.parseInt(""+GridY.elementAt(i));
                      gridW = Integer.parseInt(""+GridW.elementAt(i));
                      gridH = Integer.parseInt(""+GridH.elementAt(i));
                      rec[i] = new Rectangle2D.Double(gridX, gridY, gridW, gridH);
                      g2.draw(rec);
    catch(SQLException sqle){}
    private Vector GridX, GridY, GridW, GridH;
    private int gridX = 0, gridY = 0, gridW = 0, gridH = 0;
    Fill the point
         public void placePoint(Graphics2D g2,Point p)
              g2.setPaint(Color.red);
              g2.fill(new Ellipse2D.Double(p.x - 3, p.y - 3, 7,7));
    Create connection to Database
         public void connDB()
              System.out.println ("Connecting to Database");
              String fileName = "Pro.mdb";
              String data = "jdbc:odbc:Driver={Microsoft Access Driver " +
         "(*.mdb)};DBQ=" + fileName + ";DriverID=22";
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   conn = DriverManager.getConnection(data,"","");
                   stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                        ResultSet.CONCUR_UPDATABLE);
              catch(ClassNotFoundException ce)
              { System.out.println ("Khong tim thay Driver"); }
              catch(SQLException sqle)
              { System.out.println ("Loi SQL trong khi Connect"); }
              Statement stmt = null;
              ResultSet rs = null;
              Connection conn = null;     
    This one is the model map to draw
         private String nameOfMap = "map.jpg";
         private BufferedImage mImage;
    Initialize the path and shapes to draw
         private Line2D line[];
         private Rectangle2D.Double rec[];
         private GeneralPath backGround[];
         private Point point;
         private int changeColor = 0;
    The last one is:
    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    public class commandPanel extends JPanel implements ActionListener
    Initial check box
         JCheckBox uyBanNhanDan = new JCheckBox();
         JCheckBox nganHang = new JCheckBox();
         JCheckBox buuDien = new JCheckBox();     
         JCheckBox khachSan = new JCheckBox();     
         JCheckBox benhVien = new JCheckBox();          
         JCheckBox cho = new JCheckBox();     
         JCheckBox nhaHat = new JCheckBox();     
         JCheckBox daiHoc = new JCheckBox();     
         JCheckBox thuvien = new JCheckBox();     
         JCheckBox nhaTho = new JCheckBox();     
         public commandPanel()
              this.setLayout(new BorderLayout());
              this.setBorder(BorderFactory.createCompoundBorder(
                          BorderFactory.createTitledBorder("***Chu dan***"),
                          BorderFactory.createEmptyBorder(5,5,5,5)));
    Create the combobox to show information
              uyBanNhanDan.setText("Uy Ban ND Quan");
              nganHang.setText("Ngan Hang");
              buuDien.setText("Buu Dien");
              khachSan.setText("Khach San");
              benhVien.setText("Benh Vien");
              cho.setText("Cho - Mua Sam");
              nhaHat.setText("Nha Hat");
              daiHoc.setText("Dai Hoc - Dao Tao");
              thuvien.setText("Thu Vien - Nha Sach");
              nhaTho.setText("Nha Tho - Chua");
              uyBanNhanDan.addActionListener(this);
              nganHang.addActionListener(this);
              buuDien.addActionListener(this);
              khachSan.addActionListener(this);
              benhVien.addActionListener(this);
              cho.addActionListener(this);
              nhaHat.addActionListener(this);
              daiHoc.addActionListener(this);
              thuvien.addActionListener(this);
              nhaTho.addActionListener(this);
              uyBanNhanDan.setActionCommand("1");
              nganHang.setActionCommand("2");
              buuDien.setActionCommand("3");
              khachSan.setActionCommand("4");
              benhVien.setActionCommand("5");
              cho.setActionCommand("6");
              nhaHat.setActionCommand("7");
              daiHoc.setActionCommand("8");
              thuvien.setActionCommand("10");
              nhaTho.setActionCommand("11");
              JPanel secP = new JPanel();
              secP.setLayout(new GridLayout(5,2));
              secP.add(uyBanNhanDan);
              secP.add(nganHang);
              secP.add(buuDien);
              secP.add(khachSan);
              secP.add(benhVien);
              secP.add(cho);
              secP.add(nhaHat);
              secP.add(daiHoc);
              secP.add(thuvien);
              secP.add(nhaTho);
              this.add(secP,BorderLayout.NORTH);
         public void actionPerformed(ActionEvent event)
              int x = 0;
              int y = 0;
              try
                   mapPanel mp = new mapPanel();
                   int idDiaDanh = 0;
                   if(event.getActionCommand() == "1")
                        idDiaDanh = 1;
                   String Query =
                   "SELECT CoorX, CoorY FROM MoTa WHERE IDDiaDanh =" + idDiaDanh;
                   mp.rs = mp.stmt.executeQuery(Query);
                   while(mp.rs.next())
    /*I have problem here*/
    /*Process the event for me*/          x = mp.rs.getInt(1);
                        y = mp.rs.getInt(2);
                        Graphics g2 = mp.getGraphics();
                        mp.paintComponents(g2);
                             g2.setPaint(Color.red);
                             g2.fill(new Ellipse2D.Double(x - 3, y - 3, 7, 7));     
              catch(SQLException sqle){}

    Strings are Objects.
    String[] strings = new String[3];
    String[0]="abcde";Right here, you are initializing the String array, and the String at index 0.
    JButton[] buttons = new JButton[2];
    buttons[0].setText("abcde");Right here, you are initializing the JButton array, but not any of the JButtons in the array. You then try to use the setText() method on a null JButton.

  • Here is the source code to JMF Webcam app + saves jpeg

    Since so many people ask for this code, but never get it, I figured I'd repost it. I didn't write it, but I added the jpeg saving part, and modified it for my device, which you will have to do to get it to work. Just go into JMFRegistry and get the device name from your webcam and then edit the code. Also, keep in mind that some webcams don't work with JMF. You have to have a webcam that supports VFW or WDM interface.
    And here's the code:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    public class SwingCapture extends Panel implements ActionListener
      public static Player player = null;
      public CaptureDeviceInfo di = null;
      public MediaLocator ml = null;
      public JButton capture = null;
      public Buffer buf = null;
      public Image img = null;
      public VideoFormat vf = null;
      public BufferToImage btoi = null;
      public ImagePanel imgpanel = null;
      public SwingCapture()
        setLayout(new BorderLayout());
        setSize(320,550);
        imgpanel = new ImagePanel();
        capture = new JButton("Capture");
        capture.addActionListener(this);
        String str1 = "vfw:Logitech USB Video Camera:0";
        String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";
        di = CaptureDeviceManager.getDevice(str2);
        ml = di.getLocator();
        try
          player = Manager.createRealizedPlayer(ml);
          player.start();
          Component comp;
          if ((comp = player.getVisualComponent()) != null)
            add(comp,BorderLayout.NORTH);
          add(capture,BorderLayout.CENTER);
          add(imgpanel,BorderLayout.SOUTH);
        catch (Exception e)
          e.printStackTrace();
      public static void main(String[] args)
        Frame f = new Frame("SwingCapture");
        SwingCapture cf = new SwingCapture();
        f.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
          playerclose();
          System.exit(0);}});
        f.add("Center",cf);
        f.pack();
        f.setSize(new Dimension(320,550));
        f.setVisible(true);
      public static void playerclose()
        player.close();
        player.deallocate();
      public void actionPerformed(ActionEvent e)
        JComponent c = (JComponent) e.getSource();
        if (c == capture)
          // Grab a frame
          FrameGrabbingControl fgc = (FrameGrabbingControl)
          player.getControl("javax.media.control.FrameGrabbingControl");
          buf = fgc.grabFrame();
          // Convert it to an image
          btoi = new BufferToImage((VideoFormat)buf.getFormat());
          img = btoi.createImage(buf);
          // show the image
          imgpanel.setImage(img);
          // save image
          saveJPG(img,"c:\\test.jpg");
      class ImagePanel extends Panel
        public Image myimg = null;
        public ImagePanel()
          setLayout(null);
          setSize(320,240);
        public void setImage(Image img)
          this.myimg = img;
          repaint();
        public void paint(Graphics g)
          if (myimg != null)
            g.drawImage(myimg, 0, 0, this);
      public static void saveJPG(Image img, String s)
        BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = bi.createGraphics();
        g2.drawImage(img, null, null);
        FileOutputStream out = null;
        try
          out = new FileOutputStream(s);
        catch (java.io.FileNotFoundException io)
          System.out.println("File Not Found");
        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
        JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
        param.setQuality(0.5f,false);
        encoder.setJPEGEncodeParam(param);
        try
          encoder.encode(bi);
          out.close();
        catch (java.io.IOException io)
          System.out.println("IOException");

    Hi William,
    I've tried this code but I always get an null fgc with the following line.
    FrameGrabbingControl fgc = (FrameGrabbingControl)player.getControl("javax.media.control.FrameGrabbingCotrol");
    So the player returns always null. The other thigns seem to be fine. I can view the image in the application but when I click capture it throws a Null Pointer Exception because fgc is null.
    I am using Logitech QuickCam, USB, Win2k, jdk 1.3.1, JMF 2.1.1
    Can you help me?
    thanx,
    Philip
    Since so many people ask for this code, but never get
    it, I figured I'd repost it. I didn't write it, but I
    added the jpeg saving part, and modified it for my
    device, which you will have to do to get it to work.
    Just go into JMFRegistry and get the device name from
    your webcam and then edit the code. Also, keep in mind
    that some webcams don't work with JMF. You have to
    have a webcam that supports VFW or WDM interface.
    And here's the code:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    public class SwingCapture extends Panel implements
    ActionListener
    public static Player player = null;
    public CaptureDeviceInfo di = null;
    public MediaLocator ml = null;
    public JButton capture = null;
    public Buffer buf = null;
    public Image img = null;
    public VideoFormat vf = null;
    public BufferToImage btoi = null;
    public ImagePanel imgpanel = null;
    public SwingCapture()
    setLayout(new BorderLayout());
    setSize(320,550);
    imgpanel = new ImagePanel();
    capture = new JButton("Capture");
    capture.addActionListener(this);
    String str1 = "vfw:Logitech USB Video Camera:0";
    String str2 = "vfw:Microsoft WDM Image Capture
    ure (Win32):0";
    di = CaptureDeviceManager.getDevice(str2);
    ml = di.getLocator();
    try
    player = Manager.createRealizedPlayer(ml);
    player.start();
    Component comp;
    if ((comp = player.getVisualComponent()) !=
    )) != null)
    add(comp,BorderLayout.NORTH);
    add(capture,BorderLayout.CENTER);
    add(imgpanel,BorderLayout.SOUTH);
    catch (Exception e)
    e.printStackTrace();
    public static void main(String[] args)
    Frame f = new Frame("SwingCapture");
    SwingCapture cf = new SwingCapture();
    f.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    playerclose();
    System.exit(0);}});
    f.add("Center",cf);
    f.pack();
    f.setSize(new Dimension(320,550));
    f.setVisible(true);
    public static void playerclose()
    player.close();
    player.deallocate();
    public void actionPerformed(ActionEvent e)
    JComponent c = (JComponent) e.getSource();
    if (c == capture)
    // Grab a frame
    FrameGrabbingControl fgc =
    fgc = (FrameGrabbingControl)
    player.getControl("javax.media.control.FrameGrabbingCo
    trol");
    buf = fgc.grabFrame();
    // Convert it to an image
    btoi = new
    = new BufferToImage((VideoFormat)buf.getFormat());
    img = btoi.createImage(buf);
    // show the image
    imgpanel.setImage(img);
    // save image
    saveJPG(img,"c:\\test.jpg");
    class ImagePanel extends Panel
    public Image myimg = null;
    public ImagePanel()
    setLayout(null);
    setSize(320,240);
    public void setImage(Image img)
    this.myimg = img;
    repaint();
    public void paint(Graphics g)
    if (myimg != null)
    g.drawImage(myimg, 0, 0, this);
    public static void saveJPG(Image img, String s)
    BufferedImage bi = new
    new BufferedImage(img.getWidth(null),
    img.getHeight(null), BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = bi.createGraphics();
    g2.drawImage(img, null, null);
    FileOutputStream out = null;
    try
    out = new FileOutputStream(s);
    catch (java.io.FileNotFoundException io)
    System.out.println("File Not Found");
    JPEGImageEncoder encoder =
    r = JPEGCodec.createJPEGEncoder(out);
    JPEGEncodeParam param =
    m = encoder.getDefaultJPEGEncodeParam(bi);
    param.setQuality(0.5f,false);
    encoder.setJPEGEncodeParam(param);
    try
    encoder.encode(bi);
    out.close();
    catch (java.io.IOException io)
    System.out.println("IOException");

  • Showing swing components in the palette og jdeveloper

    hello, I have found a problem with jdeveloper, as a user uses jdeveloper since 2 years I have never found a problem like this. (IDE problem).
    like habitude I created a simple java project which contains a jframe and an entry class (main class), but when I try to drag and drop from the component palette somes swing components I didn't find
    the page of swing components ( I found in the components palette just "my components" page in the jcombobox selection category). this problem will delay a big project and causes big problems
    please any person who know some things help me as soon as possible.
    Best Regards.

    Check this post -
    showing palette containing JButton,JLabel,JPanel ... components

  • Swing components in applet not working in web browser

    Hi Guys,
    I've created an applet which makes use of some swing components, but unfortunately, not all of them function properly in my web browser (internet explorer or Mozilla Firefox). Its mainly the buttons; the last buttons works and displays the correct file within the broswer, but the first 5 buttons do not work...
    any help please on how I can sort this problem out?
    Heres the code for my applet:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.applet.*;
    public class MainAppWindow extends JApplet
    int gapBetweenButtons = 5;
    final JPanel displayPanel = new JPanel(new BorderLayout());
    public void init()
       //Panel for overall display in applet window.
       JPanel mainPanel = new JPanel(new BorderLayout());
       mainPanel.add(new JLabel(new ImageIcon(getClass().getResource("images/smalllogo2.gif"))),BorderLayout.NORTH);
       //sub mainPanel which holds all mainPanels together.
       JPanel holdingPanel = new JPanel(new BorderLayout());
       //Panel for displaying all slide show and applications in.
       displayPanel.setBackground(Color.white);
       displayPanel.add(new JLabel(new ImageIcon(getClass().getResource("images/IntroPage.jpg"))),BorderLayout.CENTER);
       displayPanel.setPreferredSize(new Dimension(590,400));
       JPanel buttonPanel = new JPanel(new GridLayout(6,1,0,gapBetweenButtons));
       buttonPanel.setBackground(Color.white);
       JButton button1 = new JButton("User guide");
       button1.addActionListener(
         new ActionListener() {
              public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll(); // If there are any components in the mainPanel, remove them and then add label
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/UserGuide.jpg")));
                   displayPanel.revalidate(); // Validates displayPanel to allow changes to occur onto it, allowing to add different number images/applicaions to it.
       JButton button2 = new JButton("What is a Stack?");
       button2.addActionListener(
       new ActionListener() {
               public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/WhatIsAStack.jpg")));
                   displayPanel.revalidate();
       JButton button3 = new JButton("STACK(ADT)");
       button3.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/StackADT.jpg")));
                   displayPanel.revalidate();
       JButton button4 = new JButton("Stacks in the Real World");
       button4.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                   if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                   displayPanel.setBackground(Color.white);
                   displayPanel.add(new JLabel(new ImageIcon("images/StacksInTheRealWorld.jpg")));
                   displayPanel.revalidate();
       JButton button5 = new JButton("DEMONSTRATION");
       button5.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                 if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                 Demonstration app = new Demonstration();
                 JPanel appPanel = app.createComponents();//gets the created components from Demonstration application.
                 appPanel.setBackground(Color.pink);
               displayPanel.add(appPanel);
               displayPanel.revalidate();
       JButton button6 = new JButton("Towers Of Hanoi");
       button6.addActionListener(
       new ActionListener() {
             public void actionPerformed(ActionEvent e)
                     if(displayPanel.getComponents().length > 0)displayPanel.removeAll();
                     TowerOfHanoi app = new TowerOfHanoi();
                     JPanel appPanel = app.createComponents();//gets the created components from Towers of Hanoi
                     JPanel mainPanel = new JPanel();//panel used to centralise the application in center
                     mainPanel.add(appPanel);
                     mainPanel.setBackground(Color.pink); //sets mainPanel's background color for 'Towers Of Hanoi'
                     displayPanel.add(mainPanel);
                     displayPanel.revalidate();
       //adding buttons to the buttonPanel.
       buttonPanel.add(button1);
       buttonPanel.add(button2);
       buttonPanel.add(button3);
       buttonPanel.add(button4);
       buttonPanel.add(button5);
       buttonPanel.add(button6);
       JPanel p = new JPanel(); // Used so that the buttons maintain their default shape
       p.setBackground(Color.white);
       p.add(buttonPanel);
       holdingPanel.add(p,BorderLayout.WEST);
       holdingPanel.add(displayPanel,BorderLayout.CENTER);
       //Positioning of holdingPanel in mainPanel.
       mainPanel.add(holdingPanel,BorderLayout.CENTER);
       //indent mainPanel so that its not touching the applet window frame.
       mainPanel.setBorder(BorderFactory.createEmptyBorder(10,20,10,20));
       mainPanel.setBackground(Color.white);
       mainPanel.setPreferredSize(new Dimension(850,600)); //size of applet window
       mainPanel.setOpaque(false); // Needed for Applet
       this.setContentPane(mainPanel);
    }

    Thanks for the response. I don't quite understand what you're talking about though. I have, in my humble knowledge, done nothing with packages. I have put the applet class (WiaRekenToolActiz.class is the applet class) in the jar file wia_actiz_archive.jar. From what I read on the tutorial, java looks for the applet class in all the jar files specified. Since I put my CODEBASE as the main url, I thought it baiscally didn't matter where you out the html file.
    I shall include the complete html page complete with applet tag to perhaps illuminate a bit more what I mean...
    <html>
    <head>
    <title>Wia Rekenmodule hello!</title>
    </head>
    <body bgcolor="#C0C0C0">
    <applet
    CODEBASE= "http://www.creativemathsolutions.nl/test"
    ARCHIVE= "Actiz/wia_actiz_archive.jar, Generic/wia_archive.jar"
    CODE="WiaRekenToolActiz.class" 
    WIDTH=915 HEIGHT=555
    >
    <PARAM NAME = naam VALUE = "Piet Janssen">
    <PARAM NAME = gebdag VALUE = "01">
    <PARAM NAME = gebmaand VALUE = "06">
    <PARAM NAME = gebjaar VALUE = "1970">
    <PARAM NAME = geslacht VALUE = "man">
    <PARAM NAME = dienstjaren VALUE = "10">
    <PARAM NAME = salaris VALUE = "56500">
    <PARAM NAME = deeltijdpercentage VALUE = "100">
    <PARAM NAME = accountnaam VALUE = "Zorginstelling 'De Zonnebloem'">
    </applet>
    </body>
    </html>

Maybe you are looking for

  • Need help to choose a DAQ for simultaneous sampling

    We need to choose a DAQ for simultaneous sampling. The restrictions are: a) 2 channels b) The signals on both channels are not continuous. A valid input on the channels is signaled by a falling edge in a third line that can be used as a trigger. c) T

  • How to sync with multiple computers?

    I have my iTunes library on my MacBook and all of my Apple devices synced accordingly. My family also has an iMac, and I would like other family members to be able to sync from the iMac. I know I can use Home Sharing to allow the iMac to view/play th

  • Ipod not Recognized by Comp or Itunes

    I currently own a first generation iPod nano that I haven't used for about an year. I tried to plug it into my computer, but iTunes doesn't open up like it's supposed to. I have a Windows Vista Home Edition. I also cannot access disc mode for some re

  • ZPL problem with layout A5 landscape

    The data in my ZPL is not complete. I generate ZPL using GeneratePrintedOutput2. I use the zpl300.xdc. The XDP size is DIN A5 page orientation is landscape. When I switch it to page orientation = portait the data is complete. Does Adobe ZPL not work

  • Serial Number missing

    Hi, I have been using Aperture since Xmas (was a Xmas present). I tried opening Aperture today to edit my new holiday photos, and it said I need to enter the serial number (I did this already when I first received the product). I have looked everywhe