Graphics 2D in program

Im new to java and was wondering how id go about using Graphics in a program as apposed to an applet. All of the graphics examples ive seen have been for applets...
I apologize if this is a very obvious and stupid question...

At the level of Graphics, there's nothing different between Applet and "regular" application. Every Component is given a Graphics into which it draws its stuff. Therefore, if you want a graphically oriented application, just subclass Canvas, and draw away, and it doesn't matter whether it's an Applet or not.
BTW, you can make an Applet launchable as a regular application approximately as follows (if you look at Applet's class hierarchy, you find it's just a Panel)
public class B extends java.applet.Applet {
... set up Components for Applet ...
public void init() {
..normal initialization, including Component setup..
public void start() {
..start stuff ...
... implement other Applet methods...
void makeFrame() {
Frame f = new Frame("Title");
f.addWindowListener( new WindowAdapter() {
... set up listener to close the Frame properly
f.setLayout(new BorderLayout());
f.add(this, "Center");
... Depending on your application, you might want to
set up a toolbar in another section of the Frame
f.pack();
f.show();
public static void main(String[] args) {
...process args...
B b = new B();
b.init();
b.makeFrame();
b.start();

Similar Messages

  • IMac 2011 graphics card replacement program - service says no to me!

    Hello everyone,
    I have a mac with the exact specifications that are stated here in the graphics card replacement program: iMac (27-inch): AMD Radeon 6970M Video Card Replacement Program
    And the exact symptoms as well. Computer was taken to a service that is approved by Apple, but as I'm in a different country, it's not an Apple store itself. After doing diagnostics for a few weeks, they told me that this does not apply to me. They that the serial number doesn't note that Apple covers anything.
    I have no receipts or anything, had no Apple care either, but this is a replacement statement by Apple and even after having the serial number and seeing that it is the exact model having the exact symptoms - can they still say no to me? What should I do? There are no Apple stores like in other countries and if I took it to one of the official dealer stores, they're just gonna take the computer to the same official service provider. It is really unfair at the moment and I don't know what to do.
    P.s. Should I post my serial number here so maybe someone who works in an official store could help me clear up if it really does not apply?

    I had to have my graphic card replaced.  I was told that I was under the 3 year from date of purchase time limit so got it for free.  How long has it been since you purchased your iMac?

  • Looking for a graphical text popup program

    I'm looking for a really specific type of program, and I don't really know where to start since I don't really know of a simple way to describe it and put into a search engine...
    I want a program that will display a graphical popup on the screen with large text - something where I can type:
    popup "test"
    in the command line and a window or overlay will pop up showing "test" with a large font. The only thing I've seen that does this is Quicksilver for OS X: <http://www.oakinnovations.co.uk/blog/wp … arning.png>.
    For clarification: I don't mean a fully automated desktop notification program, but if one of them can provide this feature, that would work.

    skanky wrote:Also dunst and cat_osx I think it's called. I'll check it's package etc when I'm at my computer.
    Right, it's called osd_cat, and it's available through xosd.
    An image search will throw up a few screenshots.

  • Setting ALV grid Graphic properties from program

    Hi all,
    Could any one tell me how to set the properties of the histogram generated by ALV output from program.
    I want to display the value on top of the bar, by setting this property from program.
    Manually i can do this by selecting the graph icon from the alv toolbar, and in the graph, right-click the bar, and from the context menu, select 'format data series', then choose 'Data labels' tab and then select 'Show value'.
    Thanks in advance.
    regards,
    Anup

    Hi Anup
    Yes, ALV Grid uses GFW for the graphics. However, it encapsulates the graphic object and let's your intervention to some extent. To do so, you can use the parameter at the interface of the method "<b>set_table_for_first_display</b>". Here is the information about the parameter:
    <u><b>IT_ALV_GRAPHICS</b></u>
    <i> Settings for displaying the ALV list as a diagram (for example, axis labels). The row type of the table has two fields (variables/value pairs):
    PROP_ID : Assign a constant attribute of the class CL_ALV_GRAPHICS_CU with prefix CO_PROPID_ to this field to determine the changes to be made to the graphic. Use the CL_ALV_GRAPHICS_CU=>CO_PROPID_TITLE attribute, for example, to refer to the title of the diagram.
    PROP_VAL : The value of the relevant topic, for example, 'My Title'.</i>
    You can also find <b>GFW</b> programs as "<b>GFW_DEMO_*</b>". If you want, you can prepare your own graphics and override the standard graphics function of the ALV Grid or add your own graphics functionality. For these you can refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control"</a>.
    Kind regards...
    *--Serdar

  • To import Graphics using RSTXLDMC program

    Hi friends,
    I am trying  to import .tiff files using RSTXLDMC program  but on this i get an error:
    " TIFF format error: No baseline TIFF 6.0 file "
    How to resolve this problem.
    Regards,
    Anish

    hi,
    Plz refer the following links,
    [importing graphics in tiff format ???;
    [http://sap.ittoolbox.com/groups/technical-functional/sap-dev/creating-logo-in-sap-3022008]
    [TIFF 6.0 baseline error;
    [Re: TIF file upload error;
    [Re: Images in smart forms;
    Hope this will help you,
    Regards,
    Renuka S.

  • MSI AFTERBURNER Graphics Card N670GTX program failure HELP

    I'm trying to install my drivers for the graphics card as i have recently wiped my computer for personal reasons, as the software program loads up in only comes up in a half resolution so i can only see 1/3 of it. HELP!

    Still no luck  Quote from: flobelix on 15-April-14, 03:34:32
    That is not Afterburner. Uninstall current driver in safemode using >>Driver Fusion<<. After reboot install latest nvidia driver: http://www.nvidia.com/download/driverResults.aspx/73780/en-us
    Then install latest Afterburner version: https://forum-en.msi.com/index.php?topic=161235.msg1291184#msg1291184

  • Move Windows 8.1 Pro Hard Drive, Graphics Card and Programs to New Motherboard and CPU

    Want to move everything, hard drive, installed programs, video card, network adapter, ram drive, DVD, from one computer to another, nothing will change except motherboard and CPU.  Old motherboard and CPU will be installed in a new computer case which
    will revert back to a Windows 7 Pro computer with a fresh install and no programs to be used as a dedicated CAD work station. Motherboard and CPU swap will be the only change, even the RAM will be the same.  What activation problems will I encounter,
    I do not want to re-install anything, if possible.

    Hi,
    I would like to confirm what kind of licensing you used on Windows 8.1, the OEM or the retailed.
    For the OEM one, the Windows 8.1 transferred to another new Motherboard will not be activated.
    For the retailed one, you should find that the system will boot with the new motherboard, install some drivers then boot successfully.
    You will need to use telephone activation for the updated system, but should not need to re-install. When warned that you need to activate, select the "Contact Microsoft Customer Support" option and follow the instructions. With a tone dial phone
    you can do this without speaking to anyone. See http://www.eightforums.com/tutorials/24636-activate-windows-8-phone.html
    Kate Li
    TechNet Community Support

  • Graphics Program

    I am thinking about writing a calculator in java. The thing is, I wanted to know if there was some software I could download so that I wouldn't have to type the code for the buttons of the calculator. All I'd do is assemble the calculator (graphically) and the program would generate the code (sort of like FrontPage) is there such a program.

    well, I use forte its very simple and intuitive to use, and have all the components to use from awt to swing. you can also manage the buttons events easily just by 2 clicks. netbeans also have a feature to ass components graphically but is not as complete as forte. Netbeans can be downloaded for free but forte no.

  • Which is more important for Adobe CS6 and FCX on imac? Processor or Graphics Card?

    Hi, I want to get the new 27" imac when it comes out this December. It will be my first mac although I have both an iPhone and iPad. I'm and artist and aspiring filmmaker and want to run Adobe CS6 and Final Cut Pro on it. I'm looking at the highest 27" but have limited funds for additional upgrades. Apart from RAM, what would i be better off upgrading on the imac? Going from the i5 to the i7? or going for the GTX 680mx Graphics card with 2gb of memory? or going for the 1TB Fusion drive? If you could only pick one or possibly 2, which would be the best to choose for video and graphics on the programs I mentioned? (I'm not into gaming, so performance on that front is of no concern to me)

    I don't have CS6...
    1) I would max out the video card. FCP X and Motion 5 uses the GPU over the CPU for processing power. Once you buy your new iMac you can't upgrade this...
    2) FCP X and Motion 5 will use all the ram you can throw at it. I have 16 GB of ram and both programs at times uses all 16 GB of ram. I really should bump up my ram to 32 GB. I would say 16 GB is the minimum for video.
    3) The processor would be last on my list. Computers are really fast even with an i5 processor. Once you buy your new iMac you can't upgrade this...
    This is the iMac I bought last year:
    27" iMc mid-2011
    3.4GHz Quad-Core Intel Core i7
    16GB 1333MHz DDR3 SDRAM - 4x4GB
    2TB Serial ATA Drive + 256GB Solid State Drive
    AMD Radeon HD 6970M 2GB GDDR5
    Apple Magic Mouse + Magic Trackpad
    Apple Wireless Keyboard (English) & User's Guide

  • Apple graphic card replacement

    Hi,
    I own mid 2011 iMac 3,4 i7 model with 6790 2GB graphic card which is broken.
    Found Apple replacement program for those cards :
    http://9to5mac.com/2013/08/16/apple-opens-graphics-card-replacement-program-for- some-mid-2011-imacs/
    Can someone tell me is this program available for Europe, (Croatia or Bosnia & Herzegovina) ?
    Best regards,
    Dzenox

    Thanks for replies,
    I found almost  everything what you already mention here but it will be easy if would live in US.
    Europe is also not a big problem, but my country Bosnia&Herzegovina does include some other conditions due to fact that  isn't listed at Apple page of countries.
    We do have some resellers, but I want a clean proof so I can get some benefits from it.
    Btw: it is the second time I have to change graphic card and I dont want to be charged.

  • Need to change pgm to add graphics to deskpane (desk) not the overlay panel

    Hello everybody.
    I recently had help in adding graphics to my program and I unintentionally requested that my graphics be added to a overlay panel. After further development I realized that I actually need the graphics to be painted to jdeskpane DESK. I assume that by doing this that the graphics will remain where I placed them (relative to the associated frames) when the scrollbar is utilized.
    This might be a simple question, but I am new to graphics. Once I have the answer, I will analyze it and educate my self further.
    Thank you in advance,
    BAJH
    * Copyright (c) 2007 BAH
    * All rights reserved.
    package com.newsystem.common;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.geom.Line2D;
    import java.awt.geom.Point2D;
    import java.awt.geom.Rectangle2D;
    import java.beans.PropertyVetoException;
    import javax.swing.*;
    import javax.swing.JButton;
    import javax.swing.JDesktopPane;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JList;
    import javax.swing.JMenuBar;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.ListModel;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.UIManager;
    import javax.swing.event.InternalFrameEvent;
    import javax.swing.event.InternalFrameListener;
    public class A_Test_of_Frame_Connectors extends JDesktopPane {
         private static final long serialVersionUID = 1L;
         JDesktopPane desk;
         JScrollPane scrollpane;
         JInternalFrame iframe;
         JFrame frame;
         JList jList1;
         String currentframetitle;
         String currentframetip;
         String title;
         Integer maxwidth;
         Boolean definingsecondaryconnector;
         Boolean definingparentsecondaryconnector;
         Boolean definingchildsecondaryconnector;
         Rectangle secondaryparentrectangle;
         Rectangle secondarychildrectangle;
        double barb = 10.0;
        double phi = Math.toRadians(20.0);
        RenderingHints hints;
        Boolean drawline = false;
        Integer connectorcount;
        String[] connectiontype;
        String[] connectorparentframe;
        String[] connectorchildframe;
        JInternalFrame[] allframes;
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHints(hints);
            g2.setPaint(Color.blue);
            if (drawline){
                  drawConnector(g2, secondaryparentrectangle, secondarychildrectangle);
        private void drawConnector(Graphics2D g2,Rectangle r1,Rectangle r2) {
            double dx = r2.getCenterX() - r1.getCenterX();
            double dy = r2.getCenterY() - r1.getCenterY();
            double theta = Math.atan2(dy, dx);
            Point2D.Double p1 = getIntersectionPoint(r1, theta);
            Point2D.Double p2 = getIntersectionPoint(r2, theta+Math.PI);
            Line2D.Double line = new Line2D.Double(p1, p2);
            drawArrowHeads(line, g2);
            g2.draw(line);
         public A_Test_of_Frame_Connectors(){
            hints = new RenderingHints(null);
            hints.put(RenderingHints.KEY_ANTIALIASING,
                      RenderingHints.VALUE_ANTIALIAS_ON);
            hints.put(RenderingHints.KEY_STROKE_CONTROL,
                      RenderingHints.VALUE_STROKE_PURE);
              definingsecondaryconnector = false;
              frame = new JFrame("All Frames in a JDesktopPane Container");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              scrollpane = new JScrollPane(desk,
                        ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
              scrollpane.setPreferredSize(new java.awt.Dimension(9925, 9580));
              desk = new JDesktopPane();
              desk.setPreferredSize(new java.awt.Dimension(15000, 30000));
                   int i = 5;
                   for (int j = 1; j <= i; j++){
                        UIManager.getDefaults().put("InternalFrame.icon", "");
                             ListModel jList1Model =
                                  new DefaultComboBoxModel(
                                            new String[] { "Item One" });
                             title = "Frame " + j;
                             jList1 = new JList();
                             jList1.setModel(jList1Model);
                        jList1.setBounds(1, 1, 45, 54);
                        jList1.setEnabled(false);
                        iframe = new JInternalFrame("Internal Frame: " + j, false, false, false, false);
                        iframe.setName(String.valueOf(j));
                        iframe.setTitle(title);
                        Integer titlewidth;
                        if (title.length() < 30){
                             titlewidth = 265;
                        else{
                             titlewidth = title.length()*8 + 20;
                        iframe.setBounds(j*20, j*20,titlewidth , j*18 + 35);
                        iframe.add(jList1);
                        iframe.addInternalFrameListener(new InternalFrameListener(){
                             public void internalFrameClosing(InternalFrameEvent e) {}
                             public void internalFrameClosed(InternalFrameEvent e) {}
                             public void internalFrameOpened(InternalFrameEvent e) {}
                             public void internalFrameIconified(InternalFrameEvent e) {}
                             public void internalFrameDeiconified(InternalFrameEvent e) {}
                             public void internalFrameActivated(InternalFrameEvent e) {
                                  currentframetitle = e.getInternalFrame().getTitle();
                                  currentframetip = e.getInternalFrame().getToolTipText();
                                  // Connectors
                                  if (definingsecondaryconnector.equals(true)){
                                       if (definingparentsecondaryconnector.equals(true)){
                                            // Build dummy rectangle for creating connector                         
                                            secondaryparentrectangle = new Rectangle(e.getInternalFrame().getBounds());
                                            System.out.println("f name - "+e.getInternalFrame().getName());
                                            definingparentsecondaryconnector = false;
                                            definingchildsecondaryconnector = true;
                                       } else {
                                       if (definingchildsecondaryconnector.equals(true)){
                                            // Build dummy rectangle for creating connector                         
                                            secondarychildrectangle = new Rectangle(e.getInternalFrame().getBounds());
                                            // draw connector
                                               drawline = true;
                                               repaint();
                                               definingchildsecondaryconnector = false;
                             public void internalFrameDeactivated(InternalFrameEvent e) {}
                        iframe.setToolTipText("Internal Frame :" + j);
                        iframe.setVisible(true);
                        desk.add(iframe);
              scrollpane.setViewportView(desk);
              JMenuBar menubar = new JMenuBar();
              JButton SecondaryConnector = new JButton("Secondary Connector");
              SecondaryConnector.addMouseListener(new java.awt.event.MouseAdapter() {
                   public void mousePressed(java.awt.event.MouseEvent e) {
                        definingsecondaryconnector = true;
                        definingparentsecondaryconnector = true;
                        definingchildsecondaryconnector = false;                    
                        try {
                             desk.getSelectedFrame().setSelected(false);
                        } catch (PropertyVetoException e1) {
                             // TODO Auto-generated catch block
                             e1.printStackTrace();
              JPanel overlayPanel = new JPanel();
                 OverlayLayout overlay = new OverlayLayout(overlayPanel);
                 overlayPanel.setLayout(overlay);
                 this.setOpaque(false);
                 overlayPanel.add(this);
                 overlayPanel.add(scrollpane);
              menubar.add(SecondaryConnector);
              frame.setJMenuBar(menubar);
    //          frame.add(scrollpane);
              frame.add(overlayPanel);
              scrollpane.setVisible(true);
              frame.setSize(800,600);
              frame.setVisible(true);
        private Point2D.Double getIntersectionPoint(Rectangle r, double theta) {
            double cx = r.getCenterX();
            double cy = r.getCenterY();
            double w = r.getWidth()/2;
            double h = r.getHeight()/2;
            double radius = Point2D.distance(0,0,w,h);
            double x = cx + radius * Math.cos(theta);
            double y = cy + radius * Math.sin(theta);
            Point2D.Double p = new Point2D.Double();
            int outcode = r.outcode(x, y);
            switch(outcode) {
                case Rectangle2D.OUT_TOP:             // 2
                    p.x = cx - h*((x - cx)/(y - cy));
                    p.y = cy - h;
                    break;
                case Rectangle2D.OUT_LEFT:            // 1
                    p.x = cx - w;
                    p.y = cy - w*((y - cy)/(x - cx));
                    break;
                case Rectangle2D.OUT_BOTTOM:          // 8
                    p.x = cx + h*((x - cx)/(y - cy));
                    p.y = cy + h;
                    break;
                case Rectangle2D.OUT_RIGHT:           // 4
                    p.x = cx + w;
                    p.y = cy + w*((y - cy)/(x - cx));
                    break;
                default:
                    System.out.println("Non-cardinal outcode: " + outcode);
            return p;
        private void drawArrowHeads(Line2D.Double line, Graphics2D g2) {
            double dy = line.getY2() - line.getY1();
            double dx = line.getX2() - line.getX1();
            double theta = Math.atan2(dy, dx);
            drawArrowHead(line.getP2(), theta, g2);
            drawArrowHead(line.getP1(), theta+Math.PI, g2);
        private void drawArrowHead(Point2D tip, double theta, Graphics2D g2) {
            double x = tip.getX() - barb * Math.cos(theta+phi);
            double y = tip.getY() - barb * Math.sin(theta+phi);
            g2.draw(new Line2D.Double(tip.getX(), tip.getY(), x, y));
            x = tip.getX() - barb * Math.cos(theta-phi);
            y = tip.getY() - barb * Math.sin(theta-phi);
            g2.draw(new Line2D.Double(tip.getX(), tip.getY(), x, y));
         public static void main(String[] args) {
              A_Test_of_Frame_Connectors d = new A_Test_of_Frame_Connectors();
    }

    Hello everybody.
    I recently had help in adding graphics to my program and I unintentionally requested that my graphics be added to a overlay panel. After further development I realized that I actually need the graphics to be painted to jdeskpane DESK. I assume that by doing this that the graphics will remain where I placed them (relative to the associated frames) when the scrollbar is utilized.
    This might be a simple question, but I am new to graphics. Once I have the answer, I will analyze it and educate my self further.
    Thank you in advance,
    BAJH
    * Copyright (c) 2007 BAH
    * All rights reserved.
    package com.newsystem.common;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.geom.Line2D;
    import java.awt.geom.Point2D;
    import java.awt.geom.Rectangle2D;
    import java.beans.PropertyVetoException;
    import javax.swing.*;
    import javax.swing.JButton;
    import javax.swing.JDesktopPane;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JList;
    import javax.swing.JMenuBar;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.ListModel;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.UIManager;
    import javax.swing.event.InternalFrameEvent;
    import javax.swing.event.InternalFrameListener;
    public class A_Test_of_Frame_Connectors extends JDesktopPane {
         private static final long serialVersionUID = 1L;
         JDesktopPane desk;
         JScrollPane scrollpane;
         JInternalFrame iframe;
         JFrame frame;
         JList jList1;
         String currentframetitle;
         String currentframetip;
         String title;
         Integer maxwidth;
         Boolean definingsecondaryconnector;
         Boolean definingparentsecondaryconnector;
         Boolean definingchildsecondaryconnector;
         Rectangle secondaryparentrectangle;
         Rectangle secondarychildrectangle;
        double barb = 10.0;
        double phi = Math.toRadians(20.0);
        RenderingHints hints;
        Boolean drawline = false;
        Integer connectorcount;
        String[] connectiontype;
        String[] connectorparentframe;
        String[] connectorchildframe;
        JInternalFrame[] allframes;
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHints(hints);
            g2.setPaint(Color.blue);
            if (drawline){
                  drawConnector(g2, secondaryparentrectangle, secondarychildrectangle);
        private void drawConnector(Graphics2D g2,Rectangle r1,Rectangle r2) {
            double dx = r2.getCenterX() - r1.getCenterX();
            double dy = r2.getCenterY() - r1.getCenterY();
            double theta = Math.atan2(dy, dx);
            Point2D.Double p1 = getIntersectionPoint(r1, theta);
            Point2D.Double p2 = getIntersectionPoint(r2, theta+Math.PI);
            Line2D.Double line = new Line2D.Double(p1, p2);
            drawArrowHeads(line, g2);
            g2.draw(line);
         public A_Test_of_Frame_Connectors(){
            hints = new RenderingHints(null);
            hints.put(RenderingHints.KEY_ANTIALIASING,
                      RenderingHints.VALUE_ANTIALIAS_ON);
            hints.put(RenderingHints.KEY_STROKE_CONTROL,
                      RenderingHints.VALUE_STROKE_PURE);
              definingsecondaryconnector = false;
              frame = new JFrame("All Frames in a JDesktopPane Container");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              scrollpane = new JScrollPane(desk,
                        ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
              scrollpane.setPreferredSize(new java.awt.Dimension(9925, 9580));
              desk = new JDesktopPane();
              desk.setPreferredSize(new java.awt.Dimension(15000, 30000));
                   int i = 5;
                   for (int j = 1; j <= i; j++){
                        UIManager.getDefaults().put("InternalFrame.icon", "");
                             ListModel jList1Model =
                                  new DefaultComboBoxModel(
                                            new String[] { "Item One" });
                             title = "Frame " + j;
                             jList1 = new JList();
                             jList1.setModel(jList1Model);
                        jList1.setBounds(1, 1, 45, 54);
                        jList1.setEnabled(false);
                        iframe = new JInternalFrame("Internal Frame: " + j, false, false, false, false);
                        iframe.setName(String.valueOf(j));
                        iframe.setTitle(title);
                        Integer titlewidth;
                        if (title.length() < 30){
                             titlewidth = 265;
                        else{
                             titlewidth = title.length()*8 + 20;
                        iframe.setBounds(j*20, j*20,titlewidth , j*18 + 35);
                        iframe.add(jList1);
                        iframe.addInternalFrameListener(new InternalFrameListener(){
                             public void internalFrameClosing(InternalFrameEvent e) {}
                             public void internalFrameClosed(InternalFrameEvent e) {}
                             public void internalFrameOpened(InternalFrameEvent e) {}
                             public void internalFrameIconified(InternalFrameEvent e) {}
                             public void internalFrameDeiconified(InternalFrameEvent e) {}
                             public void internalFrameActivated(InternalFrameEvent e) {
                                  currentframetitle = e.getInternalFrame().getTitle();
                                  currentframetip = e.getInternalFrame().getToolTipText();
                                  // Connectors
                                  if (definingsecondaryconnector.equals(true)){
                                       if (definingparentsecondaryconnector.equals(true)){
                                            // Build dummy rectangle for creating connector                         
                                            secondaryparentrectangle = new Rectangle(e.getInternalFrame().getBounds());
                                            System.out.println("f name - "+e.getInternalFrame().getName());
                                            definingparentsecondaryconnector = false;
                                            definingchildsecondaryconnector = true;
                                       } else {
                                       if (definingchildsecondaryconnector.equals(true)){
                                            // Build dummy rectangle for creating connector                         
                                            secondarychildrectangle = new Rectangle(e.getInternalFrame().getBounds());
                                            // draw connector
                                               drawline = true;
                                               repaint();
                                               definingchildsecondaryconnector = false;
                             public void internalFrameDeactivated(InternalFrameEvent e) {}
                        iframe.setToolTipText("Internal Frame :" + j);
                        iframe.setVisible(true);
                        desk.add(iframe);
              scrollpane.setViewportView(desk);
              JMenuBar menubar = new JMenuBar();
              JButton SecondaryConnector = new JButton("Secondary Connector");
              SecondaryConnector.addMouseListener(new java.awt.event.MouseAdapter() {
                   public void mousePressed(java.awt.event.MouseEvent e) {
                        definingsecondaryconnector = true;
                        definingparentsecondaryconnector = true;
                        definingchildsecondaryconnector = false;                    
                        try {
                             desk.getSelectedFrame().setSelected(false);
                        } catch (PropertyVetoException e1) {
                             // TODO Auto-generated catch block
                             e1.printStackTrace();
              JPanel overlayPanel = new JPanel();
                 OverlayLayout overlay = new OverlayLayout(overlayPanel);
                 overlayPanel.setLayout(overlay);
                 this.setOpaque(false);
                 overlayPanel.add(this);
                 overlayPanel.add(scrollpane);
              menubar.add(SecondaryConnector);
              frame.setJMenuBar(menubar);
    //          frame.add(scrollpane);
              frame.add(overlayPanel);
              scrollpane.setVisible(true);
              frame.setSize(800,600);
              frame.setVisible(true);
        private Point2D.Double getIntersectionPoint(Rectangle r, double theta) {
            double cx = r.getCenterX();
            double cy = r.getCenterY();
            double w = r.getWidth()/2;
            double h = r.getHeight()/2;
            double radius = Point2D.distance(0,0,w,h);
            double x = cx + radius * Math.cos(theta);
            double y = cy + radius * Math.sin(theta);
            Point2D.Double p = new Point2D.Double();
            int outcode = r.outcode(x, y);
            switch(outcode) {
                case Rectangle2D.OUT_TOP:             // 2
                    p.x = cx - h*((x - cx)/(y - cy));
                    p.y = cy - h;
                    break;
                case Rectangle2D.OUT_LEFT:            // 1
                    p.x = cx - w;
                    p.y = cy - w*((y - cy)/(x - cx));
                    break;
                case Rectangle2D.OUT_BOTTOM:          // 8
                    p.x = cx + h*((x - cx)/(y - cy));
                    p.y = cy + h;
                    break;
                case Rectangle2D.OUT_RIGHT:           // 4
                    p.x = cx + w;
                    p.y = cy + w*((y - cy)/(x - cx));
                    break;
                default:
                    System.out.println("Non-cardinal outcode: " + outcode);
            return p;
        private void drawArrowHeads(Line2D.Double line, Graphics2D g2) {
            double dy = line.getY2() - line.getY1();
            double dx = line.getX2() - line.getX1();
            double theta = Math.atan2(dy, dx);
            drawArrowHead(line.getP2(), theta, g2);
            drawArrowHead(line.getP1(), theta+Math.PI, g2);
        private void drawArrowHead(Point2D tip, double theta, Graphics2D g2) {
            double x = tip.getX() - barb * Math.cos(theta+phi);
            double y = tip.getY() - barb * Math.sin(theta+phi);
            g2.draw(new Line2D.Double(tip.getX(), tip.getY(), x, y));
            x = tip.getX() - barb * Math.cos(theta-phi);
            y = tip.getY() - barb * Math.sin(theta-phi);
            g2.draw(new Line2D.Double(tip.getX(), tip.getY(), x, y));
         public static void main(String[] args) {
              A_Test_of_Frame_Connectors d = new A_Test_of_Frame_Connectors();
    }

  • Multi-core threaded program pauses

    I tried to exercise two of my quad cores using timed loops, but when I set the times down to 10 and 20 msec then the display pauses and LabView becomes non-responsive.  I have a DELL Precision 7500, so these are Intel processors.  Is the graphics causing the program to pause or something else?
    Attachments:
    Testing Labview Timed Loops w Cores.vi ‏37 KB

    As an experiment, I converted the timed loops to standard while ones.  The application ran much faster with no pauses.  Task Manager showed spikes on cores 3 and 7.  I increased the number of while loops to 5 and hit 32% processor capacity, but Task Manager showed the majority of the load still be carried by 3 and 7 but the others were starting to come up.  I wonder how NI implemented the timed loop because apparently it cannot lock down a core, but rather goes to Windows and requests run each iteration of a loop as a single thread.  The pauses could be caused by waiting for system interrupts, but that doesn't explain why it effects the other Windows applications like Task Manager.

  • Very disturbing graphics issue in system prefs

    Hi all. whenever I open the desktop/screen-saver pane in system prefs, it freezes up, and the screen saver preview locks up, forcing me to "force quit". The genius at the Apple Store showed me something interesting though: when we have the start menu active, the two pane's run smoothly, and you can choose a new desktop w/o it locking up. We isolated it as a software issue, because the graphics in other programs (iTunes visualizer, iPhoto) work just fine, and all other system prefs pane's function properly. Also the screen-saver itself works when active. Anyone having this same issue?

    I'd try installing the iLife support 9.0.3 update. It solves the "screen saver of death" issue which sounds much like what you are experiencing.
    http://discussions.apple.com/thread.jspa?threadID=2032815&start=15&tstart=0

  • Photoshop CC can't detect graphics processor

    Hi, I have an Hp pavilion desktop with a intel hd 4600. Whenever I open a psd I will get a dialog box explaining how I don't have sufficient vRAM. When I use the mouse to make brushstrokes, I can hear a squeaking coming from my computer. When I look at my performance  PS doesn't detect the graphics card, but just recently it showed up when I select: use graphics processor. However, sometimes after selecting use graphics processor the program will say it stopped working and quit.

    also I am using windows 8.1

  • Business Graphics - Download/Email

    Hello,
    I would like to download the graph generated using the Graphics FM to presentation server/send the graph as an email attachment. Is there any standard FM to do this. Any input is highly appreciated.
    Thank you.

    Uma,
      I have changed my program to use the IGS Graphs instead of the SAP Business Graphics.  The program will now run in the background and you can save the file to the app server, local PC or email the file.
      A sample program for the IGS graphics is GRAPHICS_IGS_CE_TEST.
      Sample charts can be produced using the SAP Chart Designer.  The XML commands generated can be included into the program to produce the desired result.  The SAP Chart Designer can be downloaded from the SDN Downloads section.
    https://www.sdn.sap.com/irj/sdn/nw-appserver-tools
    Regards
    Darryl

Maybe you are looking for

  • Document Date In FB50

    Hello All, Im trying to post a document through FB50, and the date is in Indian Format it shows me first DD/MM/YYYY how can I change that format to American Format, plz reply me back Thanks in Advance

  • Easy CSS  Question......but not for me :(

    Thanks up front! Have a external style sheet...... in the style sheet I have font attributes defined for a specific rule (#content), color, size, weight, family, etc. When I attempt to change one word to a different color using inline or internal it

  • Trying to compile HP / Emulex 10GbE Driver with OVM 2.2.2 SDK

    Hi I am trying to compile AN HP/EMULEX driver using the ovm 2.2.2 SDK. The driver seems to be included in OVM 3.0 by default. Card is not recognised in 2.2.2. I need a 2.2.2 driver to connect our older VM servers to a new 10GbE network. The diver is

  • Control 32-bit register with buttons

    I am quite new with Labwindows. I need to control a lot of 32-bit registers by using buttons to set or reset each bits. (It would be so complicated to manage each button by  CALLBACK function). Is there a simple way to controll array of buttons in La

  • Tooltip for components located in TableCellRenderer component

    how can I add ToolTips for each components located in TableCellRenderer component? In bellow example I took panel as TableCellRenderer component. I put two labels in it. I need diffrent tooltips for two labels. import java.util.*; import java.awt.*;