Swing & Graphics Integration

��I have a need for a specialized graphics editor. I can build the GUI and I can draw graphics; but, I'm not sure how to integrate the two. Specifically, modelling the graphic components. i.e. 2 points make a line. I'd like to instantiate a Line() object whose endpoints respond to mouse dragging, and maybe a double click to edit it's properties.
��Any suggestions or related references would be greatly appreciated.
Thanks,
Jon

��I have a need for a specialized graphics editor. I can build the GUI and I can draw graphics; but, I'm not sure how to integrate the two. Specifically, modelling the graphic components. i.e. 2 points make a line. I'd like to instantiate a Line() object whose endpoints respond to mouse dragging, and maybe a double click to edit it's properties.
��Any suggestions or related references would be greatly appreciated.
Thanks,
Jon

Similar Messages

  • Swing graphics programming

    Hello everyone!! can you help;I am new to java programming. I have this project assignment to develop a small sofware that reads a file and use the data in the file to plot the graph, the prgm can read the file when the file name is entered but getting it to plot the graph, i am struggling with. please see the code below
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.awt.Graphics.*;
    import java.awt.Graphics2D.*;
    public class BioxSim extends JFrame {
         static Float a1=200F,a2=500F;//x
    static Float b1=200F,b2=75F;//y
    //JTextField to hold input data .
    private JTextField data_in;
    private JTextField data2_in;
    //JLabel to show output results.
    private JLabel degreesC;
    private JLabel fileLabel;
    //JTextArea to hold output results.
    private JTextArea ta;
    private FileReader readfile ;
    private BufferedReader buffer ;
    private JButton loadButton;
    private JButton plotButton;
    private JButton maths1;
    private JButton maths2;
    private JButton tempConversion;
    private JButton saveButton;
    private JButton clearButton;
    private String line;
    //Constructor for GoodDocs class - this method is used to set up the GUI
    public BioxSim() {
    // call the JFrame parent class with the window title
    super("Data Conversion");
    // we need the container for JFrames in order to add components
    Container container = getContentPane();
    FlowLayout flow = new FlowLayout();
         container.setLayout(flow);
         JLabel title = new JLabel("**************************************************************** Data Conversion Program *****************************************************");
         container.add(title, new BorderLayout().NORTH);
    //pos.gridx = 00; pos.gridy = 00;
    // container.add(title);
    // private label for the input units
    JLabel units = new JLabel("X, Y Data ");
    // private label to store prompt text
    JLabel prompt = new JLabel(" Input data for [X], [Y] coorinates ");
         JLabel fileLabel = new JLabel("File been Accessed is :" +line );
         // create an instance of the JLabel holding the output result
    degreesC = new JLabel("****************************** Example data: Input Degrees F; Output DegreesC Temp ******************************");
    // pos.gridx = 0; pos.gridy = 3;
    //container.add(prompt, pos);
    // create an instance of the JTextField for a specific number of columns
    data_in = new JTextField(15);
         data2_in = new JTextField("C: ", 18 );
         ta = new JTextArea(" The Output Data is Used to Plot the graph Below.", 3,62);
         loadButton = new JButton("Load File");     
    plotButton =new JButton("PlotGraph");
    maths1 = new JButton("Maths1");
    maths2 = new JButton("Maths2");
         tempConversion = new JButton("tempConversion");
    saveButton = new JButton("Save");
         clearButton = new JButton("Clear");
    //pos.gridx =0; pos.gridy = 6;
              container.add(degreesC);
    container.add(prompt);
    container.add(data_in);
              container.add(units);
              container.add(loadButton);
    container.add(data2_in);
              container.add(plotButton);
              container.add( maths1);
              container.add(maths2);
              container.add(tempConversion);
              container.add(saveButton);
    container.add(clearButton);
              container.add(fileLabel);
    container.add(ta);
              JScrollPane scroll = new JScrollPane(ta,
                   JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                   JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
              container.add(scroll);
              CustomPanel panel = new CustomPanel();
              //Dimension dim = new Dimension(500, 400);
              //JPanel panel = new JPanel();
              panel.setPreferredSize( new Dimension(700,300));
    panel.setMinimumSize( new Dimension( 200, 100 ) );
              JScrollPane scroll1 = new JScrollPane(panel);
              container.add(scroll1);
    // register the TextField event handler - this is an inner class
    TextFieldHandler handler = new TextFieldHandler();
    data_in.addActionListener(handler);
    loadButton.addActionListener(handler);
    // set the applications size and make it visible
    setSize(800, 550);
    setVisible(true);
    class CustomPanel extends JPanel
    public void paintComponent (Graphics painter)
    painter.setColor(Color.white);
    painter.fillRect(0,0,getSize().width,getSize().height);
    Color customPurple = new Color(128,0,128);
    painter.setColor(customPurple);
    painter.drawString("graph",250,60);
    //Horizontal coordinate of the graph.
         Graphics2D X_line2D = (Graphics2D) painter;
    Line2D.Float X_line = new Line2D.Float(40F, 200F, 650F, 200F);
    X_line2D.draw(X_line);
    X_line2D.drawString("X coordinate", 50, 325);
    //Vertical coordinate of the graph.
    Graphics2D Y_line2D = (Graphics2D) painter;
    Line2D.Float Y_line = new Line2D.Float(200F, 450F, 200F, 20F);
    Y_line2D.draw(Y_line);
    //Line representing mathematical functions, where a[n],b[n] resp.are variables.
         Graphics2D Y1_line2D = (Graphics2D) painter;
         //graphdata(a2,b2);
    Line2D.Float Y1_line = new Line2D.Float(a1, b1, a2, b2);
    Y1_line2D.draw(Y1_line);
    //This method is used to execute the application */
    public static void main(String args[]) {
    // create an instance of our application
    BioxSim application = new BioxSim();
    // set the JFrame properties to respond to the window closing event
    application.setDefaultCloseOperation(
    JFrame.EXIT_ON_CLOSE );
    private String convertFtoC(String input) {
    //variables to store the real values of the Strings
    double tempF = 0.0;
    double tempC = 0.0;
    // use a try-catch block to contain data conversion exceptions
    try {
    // use the Double wrapper class to parse the string to a double
    tempF = Double.parseDouble(input);
    catch (NumberFormatException nfe) {
    // no need to do anything here - errors will leave tempF = 0.0
    // perform the conversion
    tempC = 5.0 / 9.0 * (tempF - 32.0);
    // return the result as a String
    return Double.toString(tempC);
    private String convertFtoC1(String input) {
    // variables to store the real values of the Strings
    double tempF = 0.0;
    double tempC = 0.0;
    // FileReadTest f = new FileReadTest();
    // f.readMyFile("input");
    // use a try-catch block to contain data conversion exceptions
    try {
    // use the Double wrapper class to parse the string to a double
    tempF = Double.parseDouble(input);
    catch (NumberFormatException nfe) {
    // no need to do anything here - errors will leave tempF = 0.0
    // perform the conversion
    tempC = tempF;//5.0 / 9.0 * (tempF - 32.0);
    // return the result as a String
    return Double.toString(tempC);
    /** Class TextFieldHandler implements ActionListner to provide the event handling
    for this application. It is a private inner class, which gives it access to
    all of the GoodDocs instance variables */
    private class TextFieldHandler implements ActionListener {
    /** This method is required for an ActionListener to process the events */
    public void actionPerformed(ActionEvent event) {
    String string = "";
              String filename = null;
    String taString;
    // The user pressed Enter in the JTextField textField1
    if(event.getSource() == data_in){
    // retrieve the input as a String
              // degreesC.setText("Input temperature is:" string "DegreeF");
    string = convertFtoC(event.getActionCommand());
              ta.setText(string);
    // The user pressed Enter in the JTextField textField1
    if(event.getSource() == loadButton)
              filename = string;
                   // retrieve the input as a String
         filename = data2_in.getText();
                   //fileLabel.setText("File been read is : " +filename );
         try
                        readfile = new FileReader(new File(filename));
                        buffer = new BufferedReader (readfile);
                        String lineRead = buffer.readLine();
                   //clears the imput area     
                   ta.setText("");
                        do
                        ta.append(lineRead+ "\n");
    while ((lineRead = buffer.readLine()) != null);
                   buffer.close();
                   catch (IOException e)
                        if(event.getSource() == clearButton){ 
                        ta.setText("");
    } // end of the private inner class TextFieldHandler
    } // end of public class GoodDocs
    DATA FILE e.g.
    Time[sec]     VD[g/m3]     VDFlux[g/m3h]     Flux[g/m2h]     AmbT[C]     AmbRH[%]     ProbeT[C]     ProbeRH[%]     CondenserT[C]     HeatsinkT[C]
    0     1.025237E-02     0     -108.264     16.7752     61.27579     23.63191     48.14857     23.30489     23.22949
    0.421     1.025237E-02     0     -108.264     16.7752     61.27579     23.63191     48.14857     23.30489     23.22949
    0.828     1.025237E-02     0     -108.264     16.7752     61.27579     23.63191     48.14857     23.30489     23.22949
    1.218     1.025581E-02     3.179105E-02     -108.229     16.7752     61.2831     23.63191     48.15666     23.30489     23.22949
    1.609     1.025891E-02     2.856279E-02     -108.1975     16.7752     61.28748     23.63191     48.16799     23.30489     23.22949
    1.968     1.025972E-02     8.050361E-03     -108.1893     16.7752     61.29041     23.63191     48.17554     23.30489     23.22949
    2.343     1.026729E-02

    Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.

  • Accelerate swing graphics

    Hi All
    I'm currently working on a project that includes graphical representation using swing. I got some foreground-objects that move over a background. Unfortunately the performance is not as well as I expected. Perhaps there is a better approach for solving this problem:
    general idea:
    o) I use 3 images/grahics2d-objects of these images:
    one image contains the background picture
    one image contains the foreground picture
    one image is used as a offscreen buffer
    o) I draw the background picture over the offscreen buffer
    o) I draw the foreground picture also over the offscreen buffer
    o) Finally the offscreen buffer is written to the graphics-object
    the graphics are full-screen (1024x768). Is there a better way to do this?
    I would greatly appreciate any kind of help,
    exxion

    If its animation we talking about here. Use threads to do the animation calculation. But dont use too many threads, not wise to over use the power of threads.
    Try the code. Save it as japp.java. Fix the errors. Like image filenames. As i was rushing coding this.
    import java.awt.Graphics;
    import javax.swing.*;
    import java.awt.Image;
    class ImageBackgroundDraw extends Thread {
      JFrame app;
      int x;
      int y;
      public void setXY(int a, int b) {
        x = a;
        y = b;
      public drawImage(JFrame a, Image i) {
        this.app = a;
        x = 0;
        y = 0;
        start();
      public void run() {
        while (true) {
          // Update coordinates of image.
          // I dont know maybe x++;
          // Give it a little sleep we dont want it too fast
          if (x < app.w) x++
          try { sleep(app.sleep_duration); } catch (Exception e) { }
      public void paint(Graphics g) {
         Graphics2D g2 = (Graphics2D)g; 
         g2.drawImage(Image,x,y,app);
    public class japp extends javax.swing.JFrame implements Runnable {
        boolean initG = true;// Allow first Init of buffImgSurface
        private BufferedImage buffImg = null;
        private Graphics2D buffImgSurface;   
        private Thread appThread;
        public int w; // App height;
        public int h; // App width;
        ImageBackgroundDraw[] ibd = new ImageBackgroundDraw[2];
        Image back = new Image("back.gif");
        Image fore= new Image("fore.gif");
        long start = 0;             // Frame start time
        long tick_end_time;         // End frame time
        long tick_duration;         // Time taken to display the frame
        public long sleep_duration; // How long to sleep     
        static final int MIN_SLEEP_TIME = 10, // Min time to sleep for
                         MAX_FPS = 20,        // Max frame rate.  
                         MAX_MS_PER_FRAME=1000/MAX_FPS;// MS per frame
        float fps=0;  // Current frame rate
        public japp() {
          init();
          start();
        public void setWH(int a, int b) {
            w = a;
            h = b;
        public void init() {
          ibd[0] = new ImageBackgroundDraw(this,backgroundImage);
          ibd[1] = new ImageBackgroundDraw(this,ForgroundImage);
          ibd[3] = new ImageBackgroundDraw(this,ForgroundImage);
          ibd[0].setXY(0,0);
          ibd[1].setXY(0,0);
          ibd[1].setXY(0,0);
        public void update(Graphics g) {
          Graphics2D g2 = (Graphics2D)g; 
          // Erase graphics
          buffImgSurface.setBackground(Color.black);
          buffImgSurface.clearRect(0,0,w, h);
          for (int i=0; i < ibd.length; i++) {
            ibd.paint(buffImgSurface);
          g2.drawImage(buffImg,0,0,this);
        public void paint(Graphics g) {
          if (initG == true) {           
                buffImg = (BufferedImage)createImage(w,h);
                buffImgSurface = buffImg.createGraphics();   
                initG = false;
        public void start() {
            if (appThread == null) {
                appThread = new Thread(this, "app");
                appThread.start();
        public void run() {
          // While this thread is active and running keep repeating
          while (true) {
            start = System.currentTimeMillis();
            repaint();
            tick_end_time=System.currentTimeMillis();
            tick_duration=tick_end_time - start;
            if (sleep_duration < MIN_SLEEP_TIME) {
              sleep_duration=MIN_SLEEP_TIME;
            fps = 1000 / (sleep_duration + tick_duration);
    }If you like g.drawString("FPS"+fps,1,10); to show FPS to see if there is any improvement. Otherwise try JNI!(Java Native Interface) Coding and make up your own graphic routines for your applications. You can program your Java API in Assembly with JNI!.

  • Swing Graphics

    You'll have to forgive me for my ignorance. I'm just learning Swing but I'm used to .NET where it is quite easy to add your own PaintHandlers.
    For example, my main JFrame consists of 3 panels - 1 main panel to control the layout, and 2 other panels which are on this panel.
    I would like to be able to control the graphics context for one of the panels., so in the paintComponents(g) method, I simply have this:
    Graphics2D g2d = (Graphics2D)gamePanel.getGraphics();
    g2d.drawRectangle(100,100,100,100);
    Now why will something as simple as this not work? My panel is still blank.
    Or how do I force the paintComponents method to be called from another method??
    Thanks for any help!!

    That's about exactly what I have and it still isn't painting.
    private class MyPanel extends JPanel {
              public MyPanel (GameGUI mainWin) {
                   setSize(100,mainWin.HEIGHT);
                   setBorder(BorderFactory.createEmptyBorder(30, 30, 10, 30));
                   setBackground(Color.white);
                   setLayout(new GridLayout(0, 1));                         
              public void paintComponents(Graphics g) {
                   super.paintComponents(g);
                   Graphics2D g2d = (Graphics2D)g;
                   g2d.setColor(Color.black);
                   g2d.fillRect(100,100,100,100);
                   g.setColor(Color.black);          
    g.drawRect(10,10,100,100);
    I must be doing something else wrong!

  • Caching Swings Graphics

    I'm running a big application, with many screens (JPanels) on a slow system. The average time for the system to change screens is about 200ms. The first time you visit a screen, the average time to load is 400ms. Every time after that, its about 200ms. All of the screen are on top of each other, with setVisible(false) applied to all but the visible one. The only call made when changing screens is setVisible(false) and setVisible(true) (one to turn the previous screen off, the other to turn the new one on. I'm trying to find a way to get rid of that initial 400ms, and bring it down to 200ms. Is there anyway I can cache the graphics before the page is first visited?

    Anyone?

  • Intel HD Graphics (Integrated) Driver for Windows 7 (32-bit) - ThinkPad

    Hi,
    We have been running Update retriever and Thininstaller with System Center Configuration Manager 2007 for os deployment successfully for a while. When we try to deploy a ThinkPad 1143-3LG system the videodriver for the integrated videocard is not beein installed. After searching for new updates with Machine type: 1143, Operating System Windows 7 and Language Norwegian and English i dont see that this update is available for download by the update retriever system Version 4.02.0011. Is anybody else experiencing this, and is there a reason and solution for this?
    Solved!
    Go to Solution.

    Please try the following:
    1.  Open IE and clear you Temporary Internet FIles through the Internet Options dialog
    2.  Enter the following URL in IE:  http://download.lenovo.com/catalog/1143_Win7_DESC.xml
    3.  The xml file should load and you should see "acfd..." as the first four characters of the checksum element.  If you do then save this file by clicking File - Save as... and store it in your C:\Program Files\Lenovo\Update Retriever\session folder, overwriting the one that is there.
    4.  Enter the following URL in IE:  http://download.lenovo.com/catalog/1143_Win7.xml
    5.  Save this file to the same location as in step 3, overwrite the one that is there.
    6.  Run TVUR again and search for 1143 content again.  You should now see "ThinkPad Video Features(Intel huron River GT1/GT2) for Windows... in the list.
    If the checksum at step 3 does not begin with "acfd..." then you may be behind a caching proxy server.  In that case, add the following to the URLs given above and try again: 
         ?t=1234e252  
    (just some random number)
    Let us know if that helps.

  • Awt swing javafx integration problem

    Hi !
    i'm trying to "merge" a swing component (an extension of a JPanel) in a personal javafx software.
    Is there any way to achieve my goal?
    Surfing the web i found only how to implement javafx in swing...
    thank you!

    solved by using thingsFx classes (new SwingView(swingComponent)) :)
    http://thingsfx.com/

  • Performance with Swing graphics...

    Hey all, I have a small 2d multiplayer game that I'm writing in Java. The trouble is that, despite it being simple, it runs pretty slow. I have a few theories about things that I might should do to speed it up, and I wanted to know if you guys agreed with me and if, perhaps, i fell into some sort of newbie pitfall that I didn't notice...
    1.) Running all the clients and server off of one machine. I suspect this is one good reason why it runs so slow, but my system is good (a new 1.5ghz G4 PowerBook with a gig of RAM) and I haven't gotten a chance to fire up everything on separate machines. Could it be that running 3 windows updated every 100ms is the only problem? :)
    2.) Not getting the UI's running on the event dispatching thread. I know, this is a big no-no and I have to do it regardless, but does it affect the performance?
    3.) Elliptical clipping of the viewport. The game shows a circle around each player, does clipping the view in this way hinder the speed?
    4.) Collections! I discovered the collections framework recently and have the game objects organized into Java collections. In theory, though, once the game starts, there's no need to add more game objects (so they don't need to grow dynamically). I'm wondering if it would be faster to read in everything at the beginning into a collection, then convert it to an array before the game starts and just use that the whole time.
    5.) Alpha blending. I have a few translucent objects in the view. Should these be eliminated? It does seem to run a bit faster with them gone. I have some weird ghost translucent objects that I'm trying to track down, so I suspect that'll cut the number of translucent things in half, which should give a speed boost.
    I'm sure it's difficult to tell for sure without the code, but the programs are pretty big and the questions are general. Any assistance would be greatly appreciated.
    In the meantime, I'll continue hunting for performance discussions and working on the code!
    Thanks!
    -Zach

    run a profiler. this should help you determine where the bottleneck is.
    1.) Running all the clients and server off of one machine. i'm assuming that the server will be put on a different machine when your app goes into production. but during testing, unless your server do a lot of stuff , then it should not matter.
    Could it be that running 3 windows updated every 100ms is the only problem? :not sure by what you mean Window update?
    2.) Not getting the UI's running on the event dispatching thread. I know, this is a
    big no-no and I have to do it regardless, but does it affect the performance?yes..it's a big-no-no!! how do you paint the UI? the great thing about th eevent dispatcher is that when you issue multiple repaint(), it does not paint each time..rather..it check a flag to see if a repaint is need..and then repaint th ecomponent. so, it may just repaint once. if you repaint manually..you may do this multiple time...which could slow down your application. Just beware of doing anything in the event dispatcher thread that could slow down your app or even lock th eGUI components.
    4.) Collections! .. 'm wondering if it would be faster to read in everything at the
    beginning into a collection, then convert it to an array before the game starts if this is the case..yes, using array would be faster, since th elookup is determined using th ebase address multiplied by the index and the size of th eelement. for object array..the size of the element is the adress where th eobject reside in the heap.

  • No video memory. no memory acceleration for Intel HD graphics. what now?

    I did a quick double buffering on my pc with a Intel HD graphics (integrated with CPU) and works fine but jumpy and flickering a little. I run a check on the BufferedStrategy, BufferCapability and ImageCapability (code below), and found that no video memory, image cannot be accelearated in any way and Java is using blitting to do the double buffering.
    Is this normal for Intel HD graphics or my program is flawed anywhere?
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    import java.util.*;
    public class CapTest extends Canvas{
    private GraphicsConfiguration gc=null;
    private int img_width=0, img_height=0;
    private ArrayList<String> sb=null;
    public CapTest(int w, int h){
    this.img_width=w;
    this.img_height=h;
    // fixed size of drawing canvas
    setPreferredSize(new Dimension(w,h));
    setMaximumSize(new Dimension(w,h));
    setMinimumSize(new Dimension(w,h));
    // create String array
    sb=new ArrayList<String>(20);
    @Override
    public void paint(Graphics g){
    g.setColor(Color.black);
    g.fillRect(0,0,getWidth(),getHeight());// fillRect(x,y,width,height)
    g.setColor(Color.yellow);
    int x=4,y=12;
    for (int c=0; c<sb.size(); c++){
         g.drawString(sb.get(c),x,y);
         y+=16;
    @Override
    public void update(Graphics g){
    paint(g);
    private void start(){
    int number;
    boolean b;
    // create buffers for this Canvas object
    createBufferStrategy(2);
    // create informational objects
    GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gd=ge.getDefaultScreenDevice();
    GraphicsConfiguration gc=gd.getDefaultConfiguration();
    BufferCapabilities bc=gc.getBufferCapabilities();
    ImageCapabilities fbc=bc.getFrontBufferCapabilities();
    ImageCapabilities bbc=bc.getBackBufferCapabilities();
    // create report
    sb.add("Device default information:");
    sb.add("");
    sb.add("From GraphicsDevice==>");
    sb.add(String.format("Device ID: %s",gd.getIDstring()));
    number=gd.getAvailableAcceleratedMemory();
    if (number<=0)
         sb.add(String.format("Available accelerated memory: %d bytes (Oops!)", number));
    else
         sb.add(String.format("Available accelerated memory: %d bytes", number));
    sb.add("");
    sb.add("BufferCapabilities==>");
    sb.add("Full screen mode required: "+bc.isFullScreenRequired());
    sb.add("Multiple Buffers available: "+bc.isMultiBufferAvailable());
    b=bc.isPageFlipping();
    sb.add("Use Page flipping: "+b);
    if (b)
         sb.add("FlipContents: "+bc.getFlipContents().toString());
    else
         sb.add("FlipContents: BLIT");
    sb.add("");
    sb.add("ImageCapabilities==>");
    sb.add("Front buffer accelerated: "+fbc.isAccelerated());
    sb.add("Front buffer can lose surface: "+fbc.isTrueVolatile());
    sb.add("Back buffer accelerated: "+bbc.isAccelerated());
    sb.add("Back buffer can lose surface: "+bbc.isTrueVolatile());
    // show the report
    repaint();
    public void showNow(int w, int h){
    JFrame jf=new JFrame("Hardware Capabilities Test");
    if ((w==this.img_width) && (h==this.img_height)){
         jf.setResizable(false);
    jf.add(this);
    // set up default window close action.
    jf.addWindowListener(new WindowAdapter(){
         public void windowClosing(WindowEvent e) {
              sb.clear();
              sb=null;
              System.exit(0);
    jf.pack();
    jf.setVisible(true);
    // set up reporting environment.
    this.gc=jf.getGraphicsConfiguration();
    start();
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(
         new Runnable(){
              public void run(){
                   new CapTest(640,400).showNow(640,400);
    }Without video memory, how do I create smooth animation? My pc is a Xeon 3.0 Ghz computer with 4GB memory.

    leoku wrote:
    Is this normal for Intel HD graphicsDepends on the chipset, most of them are "not so good". Heck the JDK is built to disable hardware acceleration entirely for most older chipsets.
    If you're looking to discuss this matter I would advise you to take it to java-gaming.org; people there deal with this stuff on a daily basis.

  • 1.Swing package in J2ME ? 2. Profile choice ?

    Is Swing package integrated in J2ME ?
    I actually search for tools in order to develop a java application for Sharp Zaurus.
    I heared talk about AWT which is completely integrated in Personal Profile but concerning Swing I don't know.
    What is the best choice between Personal Profile or PersonalJava to develop on such a device ?
    Thank You
    --::(Excuse my english...)::--

    Swiming is too heavy for J2ME, that's why so limited support for graphic/UI in J2ME/MIDP. However, you may have a look at LWT from Motorola which is a extension for MIDP to add more UI element such as check box etc. But I am not sure if it could be deployed in other non-MOto mobile like Nokia.
    use the lightweight AWT for PersonalJava environment if you have to finish something urgent. Though PersonalJava will be merged into PP in J2ME in the future, but it's much more mature than PP at this time. As well as too few mobileset support PP.
    Jeode(Insignia's implementation of PersonalJava) is the official partner for PPC device as initial installed on HP/Compaq iPAQ, Dell Axim as well as preinstalled on Zaurus from Sharp.
    best choice, at this time to me

  • Business Graphics API in WEBAS J2EE

    Hi,
    i have a business graphic integrated into my webdynpro application. I checked the api documentation for business graphics and found out, how to change the type of the business graphic and the number of dimensions programmatically.
    On the API, i cannot find out any further possibilities of modifing the chart programmatically. I wonder about this, because the business graphic UI - element in NetWeaver Developer studio provides much more configuration possibilities on charts.
    For example, i would like to use the averagre functions or adapt the number of labels on the chart axis. But all dynamically.
    Has anyone experience, with such advanced business graphics features and nows if it is somehow possible to get to theses features by using the NetWeaver API?
    Thank you very much in advance.
    Regards
    Christoph

    As I understand, your user management is through database, so when a user is created in your application, the parameters pass through the Action Handler -> service class-> DAO. So a better way would be write an additional class with the user management implementation of BO with a constructor or a method which would take the required user creation parameters and call it in the service class just under the user creation method of your DAO.
    As the user in your system passes some information from the front end, the same can be used to create user in BO.

  • Need some graphics card advice for using 3D and Adobe

    Below are the specs for the workstation I just bought. I'm planning on upgrading the graphics card to a GeForce GTX 570 (Fermi) 1280MB. The chassis is pretty small, and I'm concerned that it might get too hot. Does anyone have any advice as to whether this machine can handle this card, and whether or not I should by extra fans, or a water cooling system for the card? Thanks in advance!
    Processor & Memory:
    Intel® Core™ i7-2600 Processor (3.40GHz)  
    Intel® H67 Chipset  
    16GB DDR3 Memory (4 slots, 32GB MAX)
      Drives: 
    2TB SATA II Hard Drive  
    12X Blu-ray Rewritable Drive: Read AND Write CDs/DVDs/Blu-Ray Discs  
    Front Panel 19-in-1 digital multimedia card reader
      Graphics: 
    Integrated Intel® HD Graphics (dual monitor capable)
      Communications: 
    10/100/1000 Mb/s Gigabit  LAN
      Audio: 
    Flexible 8-channel audio with jack sensing
      Keyboard & Mouse: 
    USB Keyboard  
    USB Mouse
      Expandability (total bays/slots): 
    2 x 5.25" external (1 occupied)  
    1 x 3.5" external (1 occupied)  
    4 x 3.5" internal (1 occupied)  
    1 x PCI-Ex16   
    2 x PCIe x1
      Ports: 
    1x DVI  
    1x HDMI  
    2 x USB 3.0 ports (rear)  
    6 x USB 2.0 ports (2 Front, 4 Rear)  
    3 x Audio Ports  
    1x S/PDIF out  
    1x RJ45
      Operating System: 
    Genuine Microsoft Windows® 7 Home Premium, 64-bit
      Additional Software: 
    Microsoft® Office Starter (reduced functionality versions of Word and Excel; not the full version of Microsoft® Office 2010)  
    Symantec Norton Internet Security 2011 (60-day trial)
      Additional Information: 
    Dimensions: (HxWxD):  13.9" x 7.1" x 16.9" (approx.)  
    Power supply: 350W  
    Lifetime, 24/7 toll-free phone support  
    1 Year Limited Parts & Labor Warranty  
    Email and fax support M-F from 9am-6pm EST

    Here are the major failings of that "workstation":
    1) The power supply is much too weak to handle an upgrade to a GTX 570. Heck, that PSU might not have been capable of actually handling even its claimed 350W - but more like 200W. As such, it's barely capable of handling even that "workstation"'s base configuration with integrated Intel HD 2000 graphics. You will definitely need a new power supply (at least 550W, but preferably 750W to 850W) right away before you can even upgrade the graphics card at all.
    2) That PC has only one hard disk. Adobe requires a minimum of at least one additional hard disk (preferably two or more additional disks) in order to run Premiere Pro acceptably well.
    3) Change out the H67 motherboard for a Z68 motherboard. H67 cannot overclock the "limited-overclockable" i7-2600 CPU at all. And even with a Z68 motherboard, the fastest that you can run that non-K i7-2600 would be 3.9GHz.
    4) As you stated, that small case will not be enough. You will need a much bigger case to handle the load from Premiere Pro plus all of the hardware upgrades that I'm suggesting.
    Also, keep in mind that the company only offers "lifetime" technical support if you don't tinker with the PC's innards at all - not even a minor hardware upgrade or only for a vendor-approved hardware upgrade such as RAM. Once you open that case for a non-vendor-approved hardware upgrade (e.g. an upgraded power supply, an upgraded GPU or upgraded cooling), you will no longer have technical support from that company that you're getting the PC from.
    As currently equipped, that system will run about 25 to 30 times slower than a fast PC. Look at payal's 622-second result running 5.0.3 on the PPBM5 results list, with the same CPU, chipset and integrated graphics as your system: It is already more than 12 times slower (in terms of the Relative Performance Index) than a fast system - and that system is already running two disks. With only one disk for absolutely everything - the OS, media, projects, previews, cache and exports - it would be much slower than even that because SATA is only a half-duplex interface, not a full-duplex interface. As a half-duplex interface, SATA can only deliver data transfers in one direction at a time. However, video editing programs like PPro require simultaneous reads and writes. This means that the single disk must wait for data transfers in a given direction to be completed before any data starts transferring in the opposite direction.

  • Disappearing Graphics in Jpanels!

    Hi all,
    I am new to java and have a slight problem. I have two forms, one is my main form and the other is used for a settings option for changing various aspects of my program such as colours etc.
    On my main form I have 2 jPanels - one that shows my main image (it's a graph that I've created and used BufferImage to then draw it on the jPanel. The other shows a smaller version of this using similar method but scale the original image to make it smaller.
    I have a function called drawStuff which draws all the main graphs, one called drawScales which draws all the axis labels and small graphs. I called upon these when I want them to be drawn. I don't use paint() or paintcomponent() etc.
    My problem is that whenever I open my settings menu, the settings form appears over my jpanel, like it should, but all of a sudden all the images on both jpanels dissapear! so when I exit the settings menu both panels are empty! I want them to stay the way they are until I redraw them!
    public void drawStuff()
      Graphics2D l = (Graphics2D)g;         
               if (window==0){
               if ((mpress=true)| (bpre==1)){
               bpre=0;
               h.setColor(Color.white);
               h.fillRect(0,0,661,352);
               h.setColor(Color.white);
               h.fillRect(0,0,661,352);      
               h.setColor(Color.black);
               h.drawLine(0,0,0,351); // draw graph axis
               h.drawLine(0,351,661,351);
               h.setColor(jPanel9.getBackground());
               h.fillRect(1,0,660,351);
               h.setColor(jPanel10.getBackground());
               int temp=scalep;
                while (1+scalep+swp<661){
                h.fillRect((1+scalep),0,swp,351);
                scalep=scalep+swp+swp;
               if (1+scalep<661){
                h.fillRect(scalep,0,660,351);  
               scalep=temp;
               GetCols(5);
               int psize=jSlider8.getValue();
               for (int o=1;o<nolin+1;o++){   
                    if (zdata[o][1][zomlev]==1){
                        zdata[o][1][zomlev+1]=0;
                         h.fillRect(660-test1[o][1],0+test1[o][2],psize,psize);
               g.drawImage(Buffer,75,30,this);
               xl=0;
               xr=0;
               yl=0;
               yr=0;
             if (mdrag==true){
                  g.drawImage(Buffer,75,30,this);
                  g.setColor(Color.black);
                  l.setColor (Color.black);
                  l.setStroke(dashed);
                 //bottom right
                 if ((selx1 < selx2) & (sely1 < sely2)){
                 //g.setColor(Color.black);     
                 //g.drawRect(selx1, sely1, selx2-selx1, sely2-sely1);
                  g.drawRect(selx1, sely1,selx2-selx1, sely2-sely1);
                  //l.draw(rectangle);
                 xl=selx1;
                 xr=selx2;
                 yl=sely1;
                 yr=sely2;
                 //bottom left
                 if ((selx1 > selx2) & (sely1 < sely2)){
                 g.drawRect(selx2, sely1,selx1-selx2, sely2-sely1);
                 xl=selx2;
                 xr=selx1;
                 yl=sely1;
                 yr=sely2;
                 //top left
                 if ((selx1 > selx2) & (sely1 > sely2)){
                 g.drawRect(selx2, sely2,selx1-selx2, sely1-sely2);
                 xl=selx2;
                 xr=selx1;
                 yl=sely2;
                 yr=sely1;
                 //top right
                  if ((selx1 < selx2) & (sely1 > sely2)){
                 g.drawRect(selx1, sely2,selx2-selx1, sely1-sely2);
                 xl=selx1;
                 xr=selx2;
                 yl=sely2;
                 yr=sely1;
                 GetCols(4);
                 int psize=jSlider8.getValue();
                  for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((735-test1[o][1]>xl) & (735-test1[o][1]<xr) & (30+test1[o][2]>yl) & (30+test1[o][2]<yr)){               
                         g.fillRect(735-test1[o][1],30+test1[o][2],psize,psize);
                         zdata[o][1][zomlev+1]=1;
             sxl=xl;
             sxr=xr;
             syl=yl;
             syr=yr;
             l.setStroke(stroke);
               /*if ((nbox==1) | (red==0)){
               g.setColor(Color.white);
               g.fillRect(3,16, 764, 401);
               g.setColor(Color.black);
               g.drawLine(75,380,725,380); // draw graph axis
               g.drawLine(75,380,75,30);
               //timescale();
               //timetwofour();
               g.drawString(twofours,50,400);
               String minyS=String.valueOf(miny);
               g.drawString(minyS,10,380);
               g.drawString(twofoure,705,400);
               String maxyS=String.valueOf(maxy);
               g.drawString(maxyS,10,40);
               g.drawString("Peak Energy",5,205);
               g.drawString("Time of Signal",400,400);
           if (nbox==1){
                 g.setColor(Color.white); // clear previous box
                 g.fillRect(xl, yl, xr-xl+1, yr-yl+1);
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>xl) & (725-test1[o][1]<xr) & (30+test1[o][2]>yl) & (30+test1[o][2]<yr)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 nbox=0;
                 xl=0;
                 xr=0;
                 yl=0;
                 yr=0;
             if (red==1){
               g.setColor(Color.black);
               g.drawLine(75,380,725,380); // draw graph axis
               g.drawLine(75,380,75,30);
                 //bottom right
                 if ((selx1 < selx2) & (sely1 < sely2)){
                 if (sxl>0){
                 g.setColor(Color.white);
                 g.fillRect(sxl-2, syl-2, sxr-sxl+4, syr-syl+4);//all
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>sxl-3) & (725-test1[o][1]<sxr+3) & (30+test1[o][2]>syl-3) & (30+test1[o][2]<syr+3)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 g.setColor(Color.black);
                 g.drawRect(selx1, sely1,selx2-selx1, sely2-sely1);
                 g.setColor(Color.white);
                 g.fillRect(selx1+1, sely1+1, selx2-selx1-1, sely2-sely1-1);
                 xl=selx1;
                 xr=selx2;
                 yl=sely1;
                 yr=sely2;
                 //bottom left
                 if ((selx1 > selx2) & (sely1 < sely2)){
                 if (sxl>0){
                 g.setColor(Color.white);
                 g.fillRect(sxl-2, syl-2, sxr-sxl+4, syr-syl+4);//all
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>sxl-4) & (725-test1[o][1]<sxr+4) & (725-test1[o][2]>syl-4) & (30+test1[o][2]<syr+4)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 g.setColor(Color.black);
                 g.drawRect(selx2, sely1,selx1-selx2, sely2-sely1);
                 g.setColor(Color.white);
                 g.fillRect(selx2+1, sely1+1, selx1-selx2-1, sely2-sely1-1);
                 xl=selx2;
                 xr=selx1;
                 yl=sely1;
                 yr=sely2;
                 //top left
                 if ((selx1 > selx2) & (sely1 > sely2)){
                 if (sxl>0){
                 g.setColor(Color.white);
                 g.fillRect(sxl-2, syl-2, sxr-sxl+4, syr-syl+4);//all
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>sxl-4) & (725-test1[o][1]<sxr+4) & (30+test1[o][2]>syl-4) & (30+test1[o][2]<syr+4)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 g.setColor(Color.black);
                 g.drawRect(selx2, sely2,selx1-selx2, sely1-sely2);
                 g.setColor(Color.white);
                 g.fillRect(selx2+1, sely2+1, selx1-selx2-1, sely1-sely2-1);
                 xl=selx2;
                 xr=selx1;
                 yl=sely2;
                 yr=sely1;
                 //top right
                  if ((selx1 < selx2) & (sely1 > sely2)){
                 if (sxl>0){
                 g.setColor(Color.white);
                 g.fillRect(sxl-2, syl-2, sxr-sxl+4, syr-syl+4);//all
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>sxl-4) & (725-test1[o][1]<sxr+4) & (30+test1[o][2]>syl-4) & (30+test1[o][2]<syr+4)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 g.setColor(Color.black);
                 g.drawRect(selx1, sely2,selx2-selx1, sely1-sely2);
                 g.setColor(Color.white);
                 g.fillRect(selx1+1, sely2+1, selx2-selx1-1, sely1-sely2-1);
                 xl=selx1;
                 xr=selx2;
                 yl=sely2;
                 yr=sely1;
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>xl) & (725-test1[o][1]<xr) & (30+test1[o][2]>yl) & (30+test1[o][2]<yr)){
                         g.setColor(Color.blue);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
             sxl=xl;
             sxr=xr;
             syl=yl;
             syr=yr;
             if (window==0){
                 for (int o=1;o<nolin+1;o++){
                     if (red==0){
                         if (zdata[o][1][zomlev]==1){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                     //if (red==0){
                    // if (data[o][1]==1){
                    // if (((540-test1[o][1])<selx2) && ((540-test1[o][1])>selx1) && ((380-test1[o][2])>sely1) && ((380-test1[o][2])<sely2)){
                     //       g.setColor(new java.awt.Color(200, 200, 200));}
                 //   g.fillOval(540-test1[o][1],380-test1[o][2],2,2);   
          /*if (window==1){
               if ((nbox==1) | (red==0)){
               g.setColor(Color.white);
               g.fillRect(3,16, 764, 401);
               g.setColor(Color.black);
               g.drawLine(75,zeroy,725,zeroy); //  y zero axis
               g.drawLine(zerox,30,zerox,380); // x zero axis
               String minxS="0";
               g.drawString(minxS,zerox,400);
               String minyS="0";
               g.drawString(minyS,10,zeroy);
               g.drawString("Log 10 R",10,205);
               g.drawString("Difference in Time of Flight",400,400);
           if (nbox==1){
                 g.setColor(Color.white); // clear previous box
                 g.fillRect(xl, yl, xr-xl+1, yr-yl+1);
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>xl) & (725-test1[o][1]<xr) & (30+test1[o][2]>yl) & (30+test1[o][2]<yr)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 nbox=0;
                 xl=0;
                 xr=0;
                 yl=0;
                 yr=0;
             if (red==1){
               g.setColor(Color.black);
               g.drawLine(75,zeroy,725,zeroy); //  y zero axis
               g.drawLine(zerox,30,zerox,380); // x zero axis
                 //bottom right
                 if ((selx1 < selx2) & (sely1 < sely2)){
                 if (sxl>0){
                 g.setColor(Color.white);
                 g.fillRect(sxl-2, syl-2, sxr-sxl+4, syr-syl+4);//all
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>sxl-3) & (725-test1[o][1]<sxr+3) & (30+test1[o][2]>syl-3) & (30+test1[o][2]<syr+3)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 g.setColor(Color.black);
                 g.drawRect(selx1, sely1,selx2-selx1, sely2-sely1);
                 g.setColor(Color.white);
                 g.fillRect(selx1+1, sely1+1, selx2-selx1-1, sely2-sely1-1);
                 xl=selx1;
                 xr=selx2;
                 yl=sely1;
                 yr=sely2;
                 //bottom left
                 if ((selx1 > selx2) & (sely1 < sely2)){
                 if (sxl>0){
                 g.setColor(Color.white);
                 g.fillRect(sxl-2, syl-2, sxr-sxl+4, syr-syl+4);//all
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>sxl-4) & (725-test1[o][1]<sxr+4) & (725-test1[o][2]>syl-4) & (30+test1[o][2]<syr+4)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 g.setColor(Color.black);
                 g.drawRect(selx2, sely1,selx1-selx2, sely2-sely1);
                 g.setColor(Color.white);
                 g.fillRect(selx2+1, sely1+1, selx1-selx2-1, sely2-sely1-1);
                 xl=selx2;
                 xr=selx1;
                 yl=sely1;
                 yr=sely2;
                 //top left
                 if ((selx1 > selx2) & (sely1 > sely2)){
                 if (sxl>0){
                 g.setColor(Color.white);
                 g.fillRect(sxl-2, syl-2, sxr-sxl+4, syr-syl+4);//all
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>sxl-4) & (725-test1[o][1]<sxr+4) & (30+test1[o][2]>syl-4) & (30+test1[o][2]<syr+4)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 g.setColor(Color.black);
                 g.drawRect(selx2, sely2,selx1-selx2, sely1-sely2);
                 g.setColor(Color.white);
                 g.fillRect(selx2+1, sely2+1, selx1-selx2-1, sely1-sely2-1);
                 xl=selx2;
                 xr=selx1;
                 yl=sely2;
                 yr=sely1;
                 //top right
                  if ((selx1 < selx2) & (sely1 > sely2)){
                 if (sxl>0){
                 g.setColor(Color.white);
                 g.fillRect(sxl-2, syl-2, sxr-sxl+4, syr-syl+4);//all
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>sxl-4) & (725-test1[o][1]<sxr+4) & (30+test1[o][2]>syl-4) & (30+test1[o][2]<syr+4)){
                         g.setColor(Color.lightGray);                
                         g.fillOval(725-test1[o][1],30+test1[o][2],2,2);
                 g.setColor(Color.black);
                 g.drawRect(selx1, sely2,selx2-selx1, sely1-sely2);
                 g.setColor(Color.white);
                 g.fillRect(selx1+1, sely2+1, selx2-selx1-1, sely1-sely2-1);
                 xl=selx1;
                 xr=selx2;
                 yl=sely2;
                 yr=sely1;
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((725-test1[o][1]>xl) & (725-test1[o][1]<xr) & (30+test1[o][2]>yl) & (30+test1[o][2]<yr)){
                         g.setColor(Color.red);
                         g.fillOval(725-zerox+test1[o][1],30+zeroy-test1[o][2],2,2);
                     if ((725-test2[o][1]>xl) & (725-test2[o][1]<xr) & (30+test2[o][2]>yl) & (30+test2[o][2]<yr)){
                         g.setColor(Color.blue);
                         g.fillOval(725-zerox+test2[o][1],30+zeroy-test2[o][2],2,2);
                    if ((725-test3[o][1]>xl) & (725-test3[o][1]<xr) & (30+test3[o][2]>yl) & (30+test3[o][2]<yr)){
                    g.setColor(Color.green);
                   g.fillOval(725-zerox+test3[o][1],30+zeroy-test3[o][2],2,2);   
             sxl=xl;
             sxr=xr;
             syl=yl;
             syr=yr;
             if (window==1){ 
             //plot points depending on choosen sets of data 
             if ((cho==1) | (cho==4) | (cho==5) | (cho==7)){
             for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){ 
                 g.setColor(Color.red);
                   g.fillOval(zerox+test1[o][1],zeroy-test1[o][2],2,2);   
             if ((cho==2) | (cho==4) | (cho==6) | (cho==7)){
             for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){ 
                 g.setColor(Color.blue);
                   g.fillOval(zerox+test2[o][1],zeroy-test2[o][2],2,2);   
             if ((cho==3) | (cho==5) | (cho==6) | (cho==7)){
             for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){
                 g.setColor(Color.green);
                   g.fillOval(zerox+test3[o][1],zeroy-test3[o][2],2,2);   
        // =========  START HERE FOR SENSOR PAIRS ===============
           if (window==1){
               if ((mpress=true)| (bpre==1)){
               bpre=0;   
               h.setColor(Color.white);
               h.fillRect(0,0,661,352);
               h.setColor(Color.black);
               h.setColor(jPanel9.getBackground());
               h.fillRect(0,0,661,352);
               h.setColor(jPanel10.getBackground());
               scale=0;
               int factor=0;
               if (jRadioButton13.isSelected()==true){
                    factor=5;
                if (jRadioButton14.isSelected()==true){
                    factor=10;
                if (jRadioButton15.isSelected()==true){
                    factor=30;
                if (jRadioButton16.isSelected()==true){
                    factor=60;
               sw=(int)(factor/divfx);
               while (1+scale+sw<661){
               h.fillRect((1+scale+zerox),0,sw,352);
               scale=scale+sw+sw;
               if (1+scale<661){
               h.fillRect((1+scale+zerox),0,661,352); 
               scale=zerox;
               while (scale-sw-sw>0){
               h.fillRect((scale-sw-sw),0,sw,352);
               scale=scale-sw-sw;
               if (scale-sw>0){
               h.fillRect(0,0,scale-sw,352); 
               //if (1+scale<661){
               //h.fillRect(scale,0,660,351);  
               h.setColor(Color.black);
               h.drawLine(0,zeroy,661,zeroy); //  y zero axis
               h.drawLine(zerox,0,zerox,381); // x zero axis
             int psize=jSlider1.getValue();
             if ((cho==1) | (cho==4) | (cho==5) | (cho==7)){
              GetCols(6);
                 for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){
                   zdata[o][1][zomlev+1]=0; 
                   h.fillRect(zerox+test1[o][1],zeroy-test1[o][2],psize,psize);   
             if ((cho==2) | (cho==4) | (cho==6) | (cho==7)){
                  GetCols(7);
                 for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){ 
                   zdata[o][1][zomlev+1]=0;
                   h.fillRect(zerox+test2[o][1],zeroy-test2[o][2],psize,psize);   
             if ((cho==3) | (cho==5) | (cho==6) | (cho==7)){
             GetCols(8);
                 for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){
                   zdata[o][1][zomlev+1]=0;
                   h.fillRect(zerox+test3[o][1],zeroy-test3[o][2],psize,psize);   
               xl=0;
               xr=0;
               yl=0;
               yr=0;
                g.drawImage(Buffer,75,30,this);
             if (mdrag==true){
               g.drawImage(Buffer,75,30,this);
                  g.setColor(Color.black);
                  l.setColor (Color.black);
                  l.setStroke(dashed);
                 //bottom right
                 if ((selx1 < selx2) & (sely1 < sely2)){
                 //g.setColor(Color.black);     
                 //g.drawRect(selx1, sely1, selx2-selx1, sely2-sely1);
                  g.drawRect(selx1, sely1,selx2-selx1, sely2-sely1);
                  //l.draw(rectangle);
                 xl=selx1;
                 xr=selx2;
                 yl=sely1;
                 yr=sely2;
                 //bottom left
                 if ((selx1 > selx2) & (sely1 < sely2)){
                 g.drawRect(selx2, sely1,selx1-selx2, sely2-sely1);
                 xl=selx2;
                 xr=selx1;
                 yl=sely1;
                 yr=sely2;
                 //top left
                 if ((selx1 > selx2) & (sely1 > sely2)){
                 g.drawRect(selx2, sely2,selx1-selx2, sely1-sely2);
                 xl=selx2;
                 xr=selx1;
                 yl=sely2;
                 yr=sely1;
                 //top right
                  if ((selx1 < selx2) & (sely1 > sely2)){
                 g.drawRect(selx1, sely2,selx2-selx1, sely1-sely2);
                 xl=selx1;
                 xr=selx2;
                 yl=sely2;
                 yr=sely1;
             int psize=jSlider1.getValue();
             if ((cho==1) | (cho==4) | (cho==5) | (cho==7)){
              GetCols(9);
                 for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){
                     if ((75+zerox+test1[o][1]>xl) & (75+zerox+test1[o][1]<xr) & (30+zeroy-test1[o][2]>yl) & (30+zeroy-test1[o][2]<yr)){
                     g.fillRect(75+zerox+test1[o][1],30+zeroy-test1[o][2],psize,psize);   
                     zdata[o][1][zomlev+1]=1;
             if ((cho==2) | (cho==4) | (cho==6) | (cho==7)){
                  GetCols(12);
                 for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){ 
                 if ((75+zerox+test2[o][1]>xl) & (75+zerox+test2[o][1]<xr) & (30+zeroy-test2[o][2]>yl) & (30+zeroy-test2[o][2]<yr)){
                   g.fillRect(75+zerox+test2[o][1],30+zeroy-test2[o][2],psize,psize);   
               zdata[o][1][zomlev+1]=1;
             if ((cho==3) | (cho==5) | (cho==6) | (cho==7)){
             GetCols(13);
                 for (int o=1;o<nolin+1;o++){
                 if (zdata[o][1][zomlev]==1){
                 if ((75+zerox+test3[o][1]>xl) & (75+zerox+test3[o][1]<xr) & (30+zeroy-test3[o][2]>yl) & (30+zeroy-test3[o][2]<yr)){
                   g.fillRect(75+zerox+test3[o][1],30+zeroy-test3[o][2],psize,psize);   
                 zdata[o][1][zomlev+1]=1;
             sxl=xl;
             sxr=xr;
             syl=yl;
             syr=yr;
             l.setStroke(stroke);
           // =========  START HERE FOR PHASE ===============
           if (window==2){
               if ((mpress=true)| (bpre==1)){
               bpre=0;   
               h.setColor(Color.white);
               h.fillRect(0,0,661,352);
               h.setColor(jPanel9.getBackground());
               h.fillRect(1,0,165,351);
               h.fillRect(331,0,165,351);
               h.setColor(jPanel10.getBackground());
               h.fillRect(166,0,165,351);
               h.fillRect(496,0,165,351);
               h.setColor(Color.black);
               h.drawLine(0,0,0,351); // draw graph axis
               h.drawLine(0,351,661,351);
               GetCols(11);
               int psize=jSlider9.getValue();
                 for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                         zdata[o][1][zomlev+1]=0;
                         h.fillRect(660-test1[o][1],0+test1[o][2],psize,psize);
               xl=0;
               xr=0;
               yl=0;
               yr=0;
                g.drawImage(Buffer,75,30,this);
             if (mdrag==true){
               g.drawImage(Buffer,75,30,this);
                  g.setColor(Color.black);
                  l.setColor (Color.black);
                  l.setStroke(dashed);
                 //bottom right
                 if ((selx1 < selx2) & (sely1 < sely2)){
                 //g.setColor(Color.black);     
                 //g.drawRect(selx1, sely1, selx2-selx1, sely2-sely1);
                  g.drawRect(selx1, sely1,selx2-selx1, sely2-sely1);
                  //l.draw(rectangle);
                 xl=selx1;
                 xr=selx2;
                 yl=sely1;
                 yr=sely2;
                 //bottom left
                 if ((selx1 > selx2) & (sely1 < sely2)){
                 g.drawRect(selx2, sely1,selx1-selx2, sely2-sely1);
                 xl=selx2;
                 xr=selx1;
                 yl=sely1;
                 yr=sely2;
                 //top left
                 if ((selx1 > selx2) & (sely1 > sely2)){
                 g.drawRect(selx2, sely2,selx1-selx2, sely1-sely2);
                 xl=selx2;
                 xr=selx1;
                 yl=sely2;
                 yr=sely1;
                 //top right
                  if ((selx1 < selx2) & (sely1 > sely2)){
                 g.drawRect(selx1, sely2,selx2-selx1, sely1-sely2);
                 xl=selx1;
                 xr=selx2;
                 yl=sely2;
                 yr=sely1;
                 GetCols(10);
                 int psize=jSlider9.getValue();
                  for (int o=1;o<nolin+1;o++){
                     if (zdata[o][1][zomlev]==1){
                     if ((735-test1[o][1]>xl) & (735-test1[o][1]<xr) & (30+test1[o][2]>yl) & (30+test1[o][2]<yr)){               
                         g.fillRect(735-test1[o][1],30+test1[o][2],psize,psize);
                         zdata[o][1][zomlev+1]=1;
             sxl=xl;
             sxr=xr;
             syl=yl;
             syr=yr;
             l.setStroke(stroke);
    public void drawscales(){
        Font font1 = new Font("TW Cen MT", Font.BOLD,12);
        Font font2 = new Font("TW Cen MT",Font.PLAIN,10);
        Font font3 = new Font("TW Cen MT",Font.BOLD,10);
        g.setColor(Color.white);
        g.fillRect(2,2, 764, 409);
        g.setColor(Color.black); 
        if (window==0){
               g.setFont(font2);
               g.drawString(twofours,52,400);
               String minyS=String.valueOf(miny);
               g.drawString(minyS,50,383);
               g.drawString(twofoure,712,400);
               String maxyS=String.valueOf(may);
               g.drawString(maxyS,50,33);
               g.setFont(font1);
               g.drawString("Energy againt Time Graph",330,20);
               g.setFont(font3);
               g.drawString("Peak Energy",10,205);
               g.drawString("/ pJ",30,217);
               g.drawString("Time of Signal",370,400);  
               /*h.setColor(Color.black);
               h.drawLine(0,0,0,351); // draw graph axis
               h.drawLine(0,351,661,351);
               h.setColor(jPanel9.getBackground());
               h.fillRect(1,0,660,351);
               h.setColor(jPanel10.getBackground());
                while (1+scale+sw<661){
                h.fillRect((1+scale),0,sw,351);
                scale=scale+sw+sw;
               if (1+scale<661){
                h.fillRect(scale,0,660,351);  
               for (int o=1;o<nolin+1;o++){
                   GetCols(5);
                     if (zdata[o][1][zomlev]==1){
                         int psize=jSlider8.getValue();
                         h.fillRect(660-test1[o][1],0+test1[o][2],psize,psize);
               //g.drawImage(Buffer,75,30,this);
               sma.drawImage(smallpow,1,1,jPanel2);
               double ndf =((zmpmr-zmpml)/219);
               double ndyf=((zmpmt-zmpmb)/116);
               int wdp=(int)((dmax-dmix)/ndf);
               int htp=(int)((may-miy)/ndyf);
               int sx=(int)((dmix-zmpml)/ndf);
               int sy=(int)((zmpmt-may)/ndyf);
               sma.drawRect(1+sx,1+sy,wdp,htp);
        if (window==1){
               g.setColor(Color.black);
               g.setFont(font2);
               String minxS="0";
               g.drawString(minxS,zerox+72,395);
               String minyS="0";
               g.drawString(minyS,65,zeroy+34);
               g.setFont(font3);
               g.drawString("Log 10 R /",9,200);
               g.drawString("Ratio of",13,212);
               g.drawString("Energy",13,224);
               g.drawString("Difference in Time of Flight / Seconds",315,408);
               g.setFont(font1);
               g.drawString("Sensor Pairs Graph",350,20);
              /* h.setColor(Color.white);
               h.fillRect(0,0,661,352);
               h.setColor(Color.black);
               h.setColor(new java.awt.Color(240, 240, 255));
               h.fillRect(0,0,661,352);
               h.setColor(new java.awt.Color(220, 220, 255));
               scale=0;
               sw=(int)(10/divfx);
               while (1+scale+sw<661){
               h.fillRect((1+scale+zerox),0,sw,352);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

    Thanks,
    I have tried it using
    public void paintComponent(Graphics g){
    drawStuff();
    }in the main body of code and then call upon PaintComponent when I close the settings frame but it makes no difference, I still get the big white box as shown in Q3 - I've tried reading the problem solving section for swing graphics from sun but to no avail.
    Any advice on where paintcomponent should be placed / called?
    Any ideas would be great.
    Thanks,
    John

  • Should I update my laptop graphics card or is it possible?

    Should I update my laptop graphics card or not? Is it possible to do so? Please help
    My laptop model is HP Probook 4441s

    You're very welcome.
    Your notebook has switchable graphics...an Intel UMA graphics chip which uses shared system memory, and an AMD Radeon HD 7650M graphics chip, which uses discrete graphics memory.
    The AMD GPU with its discrete graphics memory are still chips soldered and integrated on the motherboard.
    That's what it means.  You assumed it was a removable card, and it is not.
    There is no reference to a graphics card in your model on any of the official HP specifications for your notebook.
    http://h18000.www1.hp.com/products/quickspecs/14306_div/14306_div.PDF
    Note on page 7...
    GRAPHICS
    Integrated:
    Intel HD Graphics 4000 (3nd Generation Intel Quad-Core i7; Dual-Core i5 and i3)
    Intel HD Graphics 3000 (2nd Generation Intel Dual-Core i5 and i3)
    Intel HD Graphics (2nd Generation Intel Celeron configurations)
    Discrete:
    AMD Radeon™ HD 7650M, with 1 GB and 2 GB dedicated DDR3 video memory
    I don't see anything there about a graphics card, do you?

  • Total available graphics memory not detected

    I was trying to connect my notebook to tv useing HDMI cable, got message - no signal, and it said to check my drivers. I checked display adapter and monitor driver, it says they are up to date.
    In performance information and tools it says - total available graphics memory not detected.
    In control panel/display/advanced settings - graphics card is listed.

    Hi,
    The following link shows its specs:
        http://www8.hp.com/emea_africa/en/products/laptops/product-detail.html?oid=7427730#!tab=specs
    It uses:
    Graphics   Integrated:
      Intel® HD Graphics
    And information is right with 64MB of VRAM. System will assign available system RAM to graphics up to max allowed when required.  Please try to hit F4 to send signals to monitor.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

Maybe you are looking for

  • Computer slow and not responding since installation of new iTunes update

    Good Morning, I downloaded the new iTunes update two days ago.  As soon as I did it my computer was freezing up and none of my programs would respond.  I uninstalled it as my computer was working fine.  I did the update again and the same thing happe

  • ERROR 801881e1 while checking for phone update

    i get the following ERROR 801881e1 while checking for my phone update. I really want some solution. pls help if anyone knows about this. i really want the amber update.

  • Problem with installer

    Hello, I have a problem with my installer. Every time I try to install / upgrade a new application, it opens, but nothing happens. Thank you for your help, Pauline

  • Passing array from JS to method of applet

    There is unable in IE pass array of values from javascript to method of applet, but in Mozilla it's working fine. In IE i have got exception: Exception: java.lang.Exception: setTest{0} :no such method exists      at sun.plugin.com.JavaClass.getMethod

  • Exception when Adding Sql Statements in an Applet.

    Hello, When I have added ResultSet statements in the programme, the programme is giving me exceptions at run time as java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. at java.lang.Throwable.<init>(Compil