Making a cross in GUI?

Wondering how to make a cross without the lines toughing the edges?

import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class Cross extends JPanel
    GeneralPath cross;
    protected void paintComponent(Graphics g)
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        if(cross == null)
            initCross();
        int w = getWidth();
        int h = getHeight();
        // fill 80 percent of min dimension
        double scale = 0.8 * Math.min(w,h)/12;
        double x = 0.1 * w;
        double y = 0.1 * h;
        AffineTransform at = AffineTransform.getTranslateInstance(x,y);
        at.scale(scale, scale);
        g2.setPaint(Color.red);
        g2.draw(at.createTransformedShape(cross));
    private void initCross()
        int[] x = { 5, 7, 7, 12, 12, 7,  7,  5, 5, 0, 0, 5, 5 };
        int[] y = { 0, 0, 5,  5,  7, 7, 12, 12, 7, 7, 5, 5, 0 };
        cross = new GeneralPath();
        cross.moveTo(x[0], y[0]);
        for(int j = 1; j < x.length; j++)
            cross.lineTo(x[j], y[j]);
    public static void main(String[] args)
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(new Cross());
        f.setSize(400,400);
        f.setLocation(200,200);
        f.setVisible(true);
}

Similar Messages

  • Making simple Cross desolves at the end of still photo clips from my library. Not making a clean disolve beteen. Single frames from the previous clip are flashing half way through the desolve. Did both a drag and drop and insert disolve.

    Making simple cross desolves at the end of still photo clips from my library.
    Not making a clean disolve between clips.
    Single frames from the previous clip are flashing half way through the desolve.
    Did both a drag and drop and insert disolve.

    Making simple cross desolves at the end of still photo clips from my library.
    Not making a clean disolve between clips.
    Single frames from the previous clip are flashing half way through the desolve.
    Did both a drag and drop and insert disolve.

  • Making clickable links in GUI?

    Hi,
    Well, I'm making an GUI application and I wanted to have a clickable link to my website, I thought using HTML would be a good bet, but it doesn't work, I was thinking of using util but I'm not exactly sure..

    Swing related questions should be posted in the Swing forum.
    JEditorPane provide some basic support for loading HTML pages. Read the API for more info.
    You can invoke IE as follows:
    **  Here is a pure Windows solution
    **  Run the code and you will be taken to a tutorial that may provide
    **  a more generic solution
    public class WindowsFileProtocolHandler
         public static void main(String[] args)
              throws Exception
              String[] cmd = new String[4];
              cmd[0] = "cmd.exe";
              cmd[1] = "/C";
              cmd[2] = "start";
              cmd[3] = "http://www.javaworld.com/javaworld/javatips/jw-javatip66.html";
    //          cmd[3] = "will.xls";
    //          cmd[3] = "mailto:";
    //          cmd[3] = "a.html";
    //          cmd[3] = "file:/c:/java/temp/a.html";
              Process process = Runtime.getRuntime().exec( cmd );
    }

  • Is Java the only real way of doing cross-platform GUI

    I'm planning a project that will involve some GUI-centric work (its essentially a spreadsheet with some functional programming features). I want to have it be cross platform because I would like to build it as a tool for first time programmers. I haven't really done much GUI programming before but from what experience I have, it seems that the JVM with Swing is the the least painful for the user. I've had some experience with Python, but can't find something that works equally well on all platforms without the user installing a lot of stuff. I've also considered going the JavaScript+browser route, but that's not something I'd like to tackle. Any other ideas?

    Trent wrote:
    Just about anything can be statically linked.  You can even statically link Python and Perl scripts with the interpreter and all the needed libraries, although that would of course hog lots and lots of space that probably isn't necessary.  Compiled languages like C and C++ are the best options for static linking imo.
    I find it contradictory that you want "to give users a single file [that] they can just click and run without having to install a bunch of frameworks first", and immediately turn to Java.  Java is not universal, and it's a significantly large framework to have to install just to run one program.  I can write a GUI program with Python and Tkinter and tell Windows users to install Python first; it's the same thing as compiling a .jar and telling Windows users to install Java first.  If you really just want a click-and-run executable, then your only option (for Windows) is a statically linked .exe.
    Difference being that most probably the user already has java, since more and more webpages require it to run.

  • Making a cross-microarchitecture grid and supercomputer

    hello,
    I was thinking "wouldn't be cool if all my old computers (PC and Macs) could all work together and do some extra processes for me and others on my network?" My question is; is there a way i can connect all these computers to a grid and make my and other computers on the network run faster? for example... I am up late at night with my MacBook Pro running some developer apps that needs more CPU speed, My friend that owns a iMac (Intel), who is sleeping, lets me use her unused cycles for my use. In the morning, i sleep, and she uses photoshop and indesign to do some complex renderings and filters, uses my unused cycles, along with my other old computers.
    is this possible? can Xgrid help?
    Thanks,
    TheMacGuy12

    hiwa wrote:
    You reset every character to the '.' at the head of the loop, so every user input, even when it is correct, is reset to '.' there by your check only reads nothing but those '.'s. It outputs 1 2 3 4 5 6 etc.I was thinking that maybe I could have the original board print only once before the main loop...but when i say replace "
    {code}char p1='.';
    char p2='.';{code}
    and so on with:
    {code}char p1; {code}
    since I wouldn't need the values to be set I would get an error message...

  • Making the leap to Mac 64-bit GUI

    Right now, the way I am handling the GUI is making a Windows-native GUI and a Mac-native GUI (Carbon).
    However, to make to a 64-bit plug-in, I am looking at moving my GUI over to Cocoa for both the 32-bit and 64-bit versions.  (To maintain 3 sets of GUIs would be way, way too much.)
    1- Should I try to implement the GUI in Cocoa or should I just move to a cross-platform GUI approach like Qt?
    2- If I do go down the Cocoa route... I can't figure out how to get a Cocoa GUI working in 32-bit Photoshop.  In the CS5 SDK, I got rid of the stuff in the DissolveUIMac.cpp file and disabled the if statement in DissolveUIMacCocoa, but this crashes Photoshop with a EXC_BAD_ACCESS error that I can't seem to track down.
    Any thoughts?  :/  Spoiled rotten by 64-bit on Windows... updating was so easy.  Thanks by the way to all the helpful people on this forum!!!!!

    I'd personally suggest using Qt - its an easy-to-learn, well-designed cross-platform library; it handles internationalization and has a lot of other benefits. And yes, it integrates reasonably easy with Adobe plugin framework.

  • String paragraph tags in cross-ref format

    Is there a way to string together Paragraph tags in a cross-reference format?
    I have a document with two Paragraph tags: ManualTitle and ManualSubtitle. In another document, I would like to insert a cross-ref to the first document that contains ManualTitle and ManualSubtitle.
    This is what I tried to no avail:
    See <$paratext[ManualTitle]> <$paratext[ManualSubtitle]> for more information.
    Because I have to select a Paragraph format when applying a cross-reference, I am only allowed to select either ManualTitle or ManualSubtitle. So...if I select ManualTitle, it only shows the text applied with ManualTitle (which, incidentally, is a variable). If I select ManualSubtitle, it only shows the text applied with ManualSubtitle (which is also a variable).
    Do I have to manually concatenate these two by simply making 1 cross-ref for
    See <$paratext[ManualTitle]>
    and another for
    <$paratext[ManualSubtitle]> for more information. ???
    Thanks in advance!
    Anne

    Anne,
    In order to reference multiple paratags, you need to first manually
    insert a cross-reference marker (and use the titling as the content
    for the marker) in the document that contains the Title and Subtitle
    tags. The best location for the marker would be at the end of the
    sub-title, keeping in mind FM's behaviour of searching backwards from
    a specified location to find matches.
    Then, in the document that you wish to insert the cross-reference,
    make sure that you have the Cross-Reference "Source Type:" set to be
    "Cross-Reference Markers". Once you point it to the file with the
    titles, the cross-ref dialogue should show you the appropriate marker
    target(s). Select that target.
    Now you can edit the cross-ref format to include the paragraphs as you
    initially tried. FM will now search backwards from the marker location
    in the target document to satisfy the criteria of your format request
    and find both the ManualSubTitle and ManualTitle paragraphs.

  • Cross tab(matrix) report in XML publisher

    hi,
    i am making a cross tab report (industry,year,amount) with row subtotal='true' (by default). i.e.
    (Industry) 2008 2009 2010 total
    abc ltd. 50 100 160 310
    xyz ltd. 100 200 300 600
    pqr ltd. 10 20 30 60
    after creating cross tab, when i am going to properties of industry this is showing <?./H?> and properties of year this is showing <?./M?> and properties of amount this is showing <?./L?> and properties of total this is showing <?./T?> which i think automatically created.
    then i have to put a condition that, if industry like pqr ltd. then total should be null otherwise this should show the total as it is.
    i.e
    (Industry) 2008 2009 2010 total
    abc ltd. 50 100 160 310
    xyz ltd. 100 200 300 600
    pqr ltd. 10 20 30
    how should i have to write condition for this in total property tag.

    Hi
    the crosstab praser now creates an in memory object to process. To get the total to hide you could use
    <?if:./H != 'pqr ltd'?><?./T1?><?end if?>
    Regards
    Tim

  • [Feedback] tarsnap-gui PKGBUILD

    Hello forum,
    I've created a PKGBUILD for the newly released beta of tarsnap-gui, and I was thinking of uploading it to AUR.
    Since this would be my first public PKGBUILD, I'd like to have some feedback on the quality of the script before going with this.
    Here it is:
    _gitname=tarsnap-gui
    pkgname=tarsnap-gui-git
    pkgver=v0.5.r2.g1b3b346
    pkgrel=1
    pkgdesc="Cross platform GUI for the Tarsnap command line client"
    arch=('i686' 'x86_64')
    url="https://github.com/Tarsnap/tarsnap-gui"
    license=('BSD')
    depends=('qt5-base')
    makedepends=('git')
    provides=('tarsnap-gui')
    source=("${_gitname}::git+https://github.com/Tarsnap/tarsnap-gui.git")
    md5sums=('SKIP')
    pkgver() {
    cd $_gitname
    git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
    build() {
    cd $_gitname
    qmake
    make
    package() {
    cd $_gitname
    install -Dm755 ./tarsnap-gui "${pkgdir}/usr/bin/tarsnap-gui"
    Thanks for your time.
    EDIT:
    I've noticed after posting that there's already a package on AUR. I'd guess this is not useful anymore then!
    Last edited by mrz87 (2015-06-12 08:11:17)

    jasonwryan wrote:Yours is a better PKGBUILD...
    Hey, thanks. Perhaps I'll contact the current maintainer to see if there's something I can do to help.

  • Cross Domain without an app is it possible?

    is it possible to make a cross domain call using javascript in SharePoint 2013? Please note that building a SharePoint hosted app is not an option for me. I just need to add a content editor webpart and make a call to List on site A from Site B. 
    Please help,

    Hi,
    For making a cross domain call in SharePoint, you can refer to the methods as below:
    Create Cross-Domain Proxy Page for Client-Side Scripts:
    http://www.sharepointjohn.com/sharepoint-2010-cross-domain-proxy-page-for-client-side-scripts/
    Enable cross domain call in web service Application:
    http://www.adobe.com/devnet/adobe-media-server/articles/cross-domain-xml-for-streaming.html
    For more information, you can refer to the thread:
    https://social.technet.microsoft.com/Forums/en-US/fc2dd1bf-9ac2-4f15-b521-626d06c2524b/cross-site-collection-rest-call-without-an-app?forum=sharepointdevelopment
    http://stackoverflow.com/questions/9469980/sharepoint-getlistitems-across-domain?rq=1
    http://stackoverflow.com/questions/9573790/cross-subdomain-sharepoint-list-access?rq=1
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • Using Swing as interface to a dll

    I am trying to use Swing as my cross platform GUI for c++ dll's. Each dll has its own GUI. However, one of my dll's controls what other dlls are loaded. This works fine until I try to load a second instance of the control dll. I get an access violation message when I try to update my gui. If I try to load the two dlls from the c++ everything works fine, but if I load one from the Java GUI I get an null access exception. I'm guessing its caused by one of two problems:
    1) The DLL loading is trashing the executing stack of either the JAVA or the native code.
    2) As the code returns from the constructor call to the newly loaded dll JNI is deleting the interface objects that it is creating on the heap.
    Any ideas would be greatly appreciated.
    Unfortunately I don't get an error log from JAVA.
    VisualStudio gives me:
    Unhandled exception at 0x10014a7d (nativedll.dll) in testjava.exe: 0xC0000005: Access violation reading location 0xfeeefef6.
    The print out reads:
    Creating Java VM
    No. Created VMs 0
    Creating Frame
    Created frame
    Begin master update loop
    Calling Update
    Updated Frame 0
    Creating Java VM
    No. Created VMs 1
    Creating Frame
    Created frame
    Calling Update
    I am using Visual Studio .Net 2003 and jdk 1.4.4, 1.5.0_08 and 1.6.0.
    Main application:
    #include "Windows.h"
    #include "nativelibrary.h"
    #include <stdlib.h>
    #include <string.h>
    #include "jni.h"
    int main(int argc, char* argv[])
           //Load first library
         HMODULE handle = LoadLibrary( "../../nativedll/debug/nativedll.dll");
         nativelibrary* (*funcPtr)();
         funcPtr = (nativelibrary*(*)())GetProcAddress( handle, "createObj");
         nativelibrary* newObj = (*funcPtr)();
            // update each library
         for (int i = 0; i < 10000; i++)
              printf ("Begin master update loop\n");
              void (*funcPtr2)();
              funcPtr2 = (void(*)())GetProcAddress( handle, "update");
              (*funcPtr2)();
              printf ("End master update loop\n");
              Sleep(10);
         // Sleep(100000);
         return 0;
    }Main Library
    #include <iostream>
    #include "jni.h"
    #include "MyFrame.h"
    #include "StaticFunc.h"
    #include <stdlib.h>
    #include <vector>
    #include "Windows.h"
    using namespace std;
    class nativelibrary
    public:
         JavaVM *jvm;
         JNIEnv *env;
         jclass cls;
         jobject myFrame;
         nativelibrary();
         void locupdate();
         static vector<nativelibrary*> objects;
    vector<nativelibrary*> nativelibrary::objects;
    nativelibrary* createObj()
         return new nativelibrary();
    nativelibrary::nativelibrary()
         // JavaVMOption options[0];
         JavaVMInitArgs vm_args;
         memset(&vm_args, 0, sizeof(vm_args));
         vm_args.version = JNI_VERSION_1_4;
         vm_args.nOptions = 0;
         vm_args.ignoreUnrecognized = true;
         vm_args.nOptions = 0;
         // vm_args.options = options;
         JavaVM** jvmBuf = (JavaVM**)malloc(sizeof(JavaVM*));
         jsize buflen = 1;
         jsize nVMs =0;
         // vm_args.options[0].optionString = "-Djava.class.path=../../bin/Debug";
         // Create the Java VM
         printf("Creating Java VM\n");
         jint res = JNI_GetCreatedJavaVMs(jvmBuf, buflen, &nVMs);
         if ( res >= 0)
              printf("No. Created VMs %i\n", nVMs);
              if ( nVMs > 0)
                   jvm = jvmBuf[0];
                   res = jvm->GetEnv((void**)&env,vm_args.version);
              else
                   res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         else
              res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         cls = env->FindClass("LMyFrame;");     
         if ( cls == 0 ) printf("Cannot find MyFrame");
         jmethodID mid = env->GetMethodID(cls, "<init>", "()V");
         if ( mid == 0 ) printf("Cannot find constructor");
         printf("Creating Frame\n");
         myFrame = env->NewObject(cls, mid);
         if (env->ExceptionOccurred())
              env->ExceptionDescribe();
         printf("Created frame\n");
         objects.push_back(this);
    void nativelibrary::locupdate()
         printf("Calling Update\n");
         jmethodID updatemid = env->GetMethodID(cls, "update", "()V");
         if ( updatemid == 0 ) printf("Cannot find update");
         env->CallVoidMethod(myFrame, updatemid);
         if (env->ExceptionOccurred())
              env->ExceptionDescribe();
    void update()
         vector<nativelibrary*>::iterator it = nativelibrary::objects.begin();
         while (it != nativelibrary::objects.end())
              nativelibrary* lib = *it;
              lib->locupdate();
              it++;
    JNIEXPORT void JNICALL Java_MyFrame__1createObj
      (JNIEnv *, jclass)
         createObj();
    }Java Class (User interface)
    class MyFrame
         static native void _createObj();
         static int creations = 0;
         int framenum;
         MyFrame()
              System.loadLibrary("../../nativedll/Debug/nativedll");
              framenum = creations++;
         void update()
              System.out.println("Updated Frame " + framenum);
              if ( creations == 1)
                   // load dll as a result of the user clicking on the interface
                   createObj();
         public static void createObj()
              _createObj();
    }

    I am trying to use Swing as my cross platform GUI for c++ dll's. Each dll has its own GUI. However, one of my dll's controls what other dlls are loaded. This works fine until I try to load a second instance of the control dll. I get an access violation message when I try to update my gui. If I try to load the two dlls from the c++ everything works fine, but if I load one from the Java GUI I get an null access exception. I'm guessing its caused by one of two problems:
    1) The DLL loading is trashing the executing stack of either the JAVA or the native code.
    2) As the code returns from the constructor call to the newly loaded dll JNI is deleting the interface objects that it is creating on the heap.
    Any ideas would be greatly appreciated.
    Unfortunately I don't get an error log from JAVA.
    VisualStudio gives me:
    Unhandled exception at 0x10014a7d (nativedll.dll) in testjava.exe: 0xC0000005: Access violation reading location 0xfeeefef6.
    The print out reads:
    Creating Java VM
    No. Created VMs 0
    Creating Frame
    Created frame
    Begin master update loop
    Calling Update
    Updated Frame 0
    Creating Java VM
    No. Created VMs 1
    Creating Frame
    Created frame
    Calling Update
    I am using Visual Studio .Net 2003 and jdk 1.4.4, 1.5.0_08 and 1.6.0.
    Main application:
    #include "Windows.h"
    #include "nativelibrary.h"
    #include <stdlib.h>
    #include <string.h>
    #include "jni.h"
    int main(int argc, char* argv[])
           //Load first library
         HMODULE handle = LoadLibrary( "../../nativedll/debug/nativedll.dll");
         nativelibrary* (*funcPtr)();
         funcPtr = (nativelibrary*(*)())GetProcAddress( handle, "createObj");
         nativelibrary* newObj = (*funcPtr)();
            // update each library
         for (int i = 0; i < 10000; i++)
              printf ("Begin master update loop\n");
              void (*funcPtr2)();
              funcPtr2 = (void(*)())GetProcAddress( handle, "update");
              (*funcPtr2)();
              printf ("End master update loop\n");
              Sleep(10);
         // Sleep(100000);
         return 0;
    }Main Library
    #include <iostream>
    #include "jni.h"
    #include "MyFrame.h"
    #include "StaticFunc.h"
    #include <stdlib.h>
    #include <vector>
    #include "Windows.h"
    using namespace std;
    class nativelibrary
    public:
         JavaVM *jvm;
         JNIEnv *env;
         jclass cls;
         jobject myFrame;
         nativelibrary();
         void locupdate();
         static vector<nativelibrary*> objects;
    vector<nativelibrary*> nativelibrary::objects;
    nativelibrary* createObj()
         return new nativelibrary();
    nativelibrary::nativelibrary()
         // JavaVMOption options[0];
         JavaVMInitArgs vm_args;
         memset(&vm_args, 0, sizeof(vm_args));
         vm_args.version = JNI_VERSION_1_4;
         vm_args.nOptions = 0;
         vm_args.ignoreUnrecognized = true;
         vm_args.nOptions = 0;
         // vm_args.options = options;
         JavaVM** jvmBuf = (JavaVM**)malloc(sizeof(JavaVM*));
         jsize buflen = 1;
         jsize nVMs =0;
         // vm_args.options[0].optionString = "-Djava.class.path=../../bin/Debug";
         // Create the Java VM
         printf("Creating Java VM\n");
         jint res = JNI_GetCreatedJavaVMs(jvmBuf, buflen, &nVMs);
         if ( res >= 0)
              printf("No. Created VMs %i\n", nVMs);
              if ( nVMs > 0)
                   jvm = jvmBuf[0];
                   res = jvm->GetEnv((void**)&env,vm_args.version);
              else
                   res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         else
              res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
         cls = env->FindClass("LMyFrame;");     
         if ( cls == 0 ) printf("Cannot find MyFrame");
         jmethodID mid = env->GetMethodID(cls, "<init>", "()V");
         if ( mid == 0 ) printf("Cannot find constructor");
         printf("Creating Frame\n");
         myFrame = env->NewObject(cls, mid);
         if (env->ExceptionOccurred())
              env->ExceptionDescribe();
         printf("Created frame\n");
         objects.push_back(this);
    void nativelibrary::locupdate()
         printf("Calling Update\n");
         jmethodID updatemid = env->GetMethodID(cls, "update", "()V");
         if ( updatemid == 0 ) printf("Cannot find update");
         env->CallVoidMethod(myFrame, updatemid);
         if (env->ExceptionOccurred())
              env->ExceptionDescribe();
    void update()
         vector<nativelibrary*>::iterator it = nativelibrary::objects.begin();
         while (it != nativelibrary::objects.end())
              nativelibrary* lib = *it;
              lib->locupdate();
              it++;
    JNIEXPORT void JNICALL Java_MyFrame__1createObj
      (JNIEnv *, jclass)
         createObj();
    }Java Class (User interface)
    class MyFrame
         static native void _createObj();
         static int creations = 0;
         int framenum;
         MyFrame()
              System.loadLibrary("../../nativedll/Debug/nativedll");
              framenum = creations++;
         void update()
              System.out.println("Updated Frame " + framenum);
              if ( creations == 1)
                   // load dll as a result of the user clicking on the interface
                   createObj();
         public static void createObj()
              _createObj();
    }

  • WHY SUCH AN INJUSTICE THAT BBM CANNOT BE USED ON MY CURVE 9300 OVER NORMAL DATA SERVICE AND OTHER PLATFORMS CAN USE!

    Hello,
    I am using Blackberry Curve 9300. I purchased this phone for Rs. 17,250 before some 3 years, I considered RIM to be a Company providing premium services which is unique in itself and which worth spending on them and the most important thing is those are not available to non-blackberry users! Especially in case of Blackberry Messenger, which is such a service connecting all the blackberry users around the world, making a mark of precious symbol of the users of BBM.
     Before few days I came to know about BBM being available on Android and Windows phones, my question is why this injustice with your own customers, you provide the app which they will use with their normal data plan and we people who are your real customers, who trusted in you have to spend not less than Rs.129 for just BBM!I must say RIM is the most back-stabbing company I have had ever dealt with! People are laughing at us as they are using the same service for almost free and we have to spend a huge sum for availing the same service, my question is are these non blackberry people your customers or we people who contributed in your success with hopes of trust?
    My question is not why you made available BBM usage to non-blackberry users with such flexibility but my question is why can't you be loyal to your own customers?
    I hope that RIM would have a pleasing justification.

    Thanks with the signature but I already removed it from my profile too.
    I was never under a rock when it comes to technology I know that in India before few months yoru Blackberry Z10 was Rs.44,000 and now it is Rs.21,000. I understand the ploy of making BBM cross platform to generate revenue, first in a technical sense and another by creating it advrtisement in the marker.
    Do you think that taking an undue advantage of our loyaty and enduring the mockery of your own customer would take you anywhere? Don't you think that abusing your own customer's prestige would even affect you negatively? While your customer is paying Rs.129 for just BBM the Android person sitting next to him is lauging at him for he paid you and call him fool! Profits doesn't starts only by making huge business decisions but from the loyal and satisfied customers. You may always find customers all around always complaining but deep down if you have touched their needs they will bless you with good words at your back, maybe in such a way that you will never come to kow but it will grow you more. I am not here to deliver you a marketing lecture as i am in corporate law field but let me tell you what I read during my graduation, it said something like one disatisfied customer can discourage ten potential customers from buying your product and I have started feeling the same in case of online shopping but I do not know when the company giant blackberry would come to know! 
    When you said about expanding customer base, think about a company who is expanding its base of customers by disatisfing their current customers who always took pride in you by providing them services at harsh terms and in front of their eyes others are getting benefits at a very low cost.
    Our family business is textile manufacturing, not as big as blackberry but we always knew that if we will start selling our goods by describing them as really premium goods and start charging out of lips and bounds, of course my product could be premium worth the price but one thing I could be missing would be a point of finance, there could be cheaper alternatives in market which could be selling at lower price which same usage. My concern is just to keep our eyes open.
    Now consider a phone on which I can use Whatsapp which satisfies my messaging needs, gtalk and yahoo messengers for my im needs, push mails for emails, browsing and downloading for just Rs.99 and on the other hand Blackberry services for Rs.389, it is indeed clear the reason of downfall, though it is labelled as premium service and indeed it could be, permium service as I said earlier.
    When you feel that your boat is sinking, you do not have only have to pull out the waters but on the priority basis you have to cover the hole too! Blackberry is just pulling out the water leaving the hole as it is!
    If you say that legacy mode in BBOS could bother you  from providing BBM for BB device, you know that it cannot be and even I know that, any technical person can know that as it is a little secret that I can use BB browser without BIS and many other apps are example of the same (to be a bit informal). See, I never asked this thing from last three years but now when you are making it cross platform why not to give a little benefits to those who paid you till now, if you can give it to those who are nothign to you?
    My question is that why can't you provide BBM to be used on the normal data paln for your own old and loyal customers who paid you such a handsome amount from many years for your services as how you provide on other platform, just for BBM not email and rest of your services?

  • Third party Stock Transport Order

    Hi,
    We have a requirement as descibed below:
    Plants A, B and C are live in SAP and belong to different company codes. The Plant B is the sales office and no production/purchasing happens at this plant. The vendor codes for Plant A & B with respective plant assignment is done and STO configuration for the procurment from Plant A to C and vice versa is set up in the system. Now, the requirement is Plant A intends to procure from plant C (in other words Plant C should deliver to Plant A) but the billing should happen from Plant B. The third party cross company sales is set up for Plant B making a cross company sales order with sales org of Plant B and production plant B for the external customer.
    One of the solution is to make the Plant A as external customer of Plant B but somehow that doesn't follow the SAP Business Global Solution of the company.
    Kindly advise if any solution from the procurement perspective (stock transport order) could serve the business requirement (Plant C to deliver to Plant A and billing from Plant B). Any kind of development should also be acceptable.
    Thanks in Advance,

    To add to what Jurgen said:
    Why would a second company code be an invoicing party? The business process doesn't make sense.
    Also had the Plant C been a part of the same company code of Plant A (Supplying plant), then cross company STO could have easily mapped the scenario, by giving the Plant C as the invoicing party (PI) in the partner function of Plant A.

  • Remove white space nodes from jtree

    I am trying to create jtree using XML DOM.
    But I m not able to remove/ignore the white space elements from DOM.
    I am getting output something like this
    for example
    Server
    Text
    node1
    Text
    I want something like this.
    Server
    node1
    I tried all option for removeing the white space
    Here I am posting the source
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import java.io.File;
    import java.io.IOException;
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMException;
    // Basic GUI components
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    // GUI components for right-hand side
    import javax.swing.JSplitPane;
    import javax.swing.JEditorPane;
    // GUI support classes
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowAdapter;
    // For creating borders
    import javax.swing.border.EmptyBorder;
    import javax.swing.border.BevelBorder;
    import javax.swing.border.CompoundBorder;
    // For creating a TreeModel
    import javax.swing.tree.*;
    import javax.swing.event.*;
    import java.util.*;
    public class DomEcho02 extends JPanel
    // Global value so it can be ref'd by the tree-adapter
    static Document document;
    static final int windowHeight = 460;
    static final int leftWidth = 300;
    static final int rightWidth = 340;
    static final int windowWidth = leftWidth + rightWidth;
    public DomEcho02()
    // Make a nice border
    EmptyBorder eb = new EmptyBorder(5,5,5,5);
    BevelBorder bb = new BevelBorder(BevelBorder.LOWERED);
    CompoundBorder cb = new CompoundBorder(eb,bb);
    this.setBorder(new CompoundBorder(cb,eb));
    // Set up the tree
    JTree tree = new JTree(new DomToTreeModelAdapter());
    // Iterate over the tree and make nodes visible
    // (Otherwise, the tree shows up fully collapsed)
    //TreePath nodePath = ???;
    // tree.expandPath(nodePath);
    // Build left-side view
    JScrollPane treeView = new JScrollPane(tree);
    treeView.setPreferredSize(
    new Dimension( leftWidth, windowHeight ));
    // Build right-side view
    JEditorPane htmlPane = new JEditorPane("text/html","");
    htmlPane.setEditable(false);
    JScrollPane htmlView = new JScrollPane(htmlPane);
    htmlView.setPreferredSize(
    new Dimension( rightWidth, windowHeight ));
    // Build split-pane view
    JSplitPane splitPane =
    new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
    treeView,
    htmlView );
    splitPane.setContinuousLayout( true );
    splitPane.setDividerLocation( leftWidth );
    splitPane.setPreferredSize(
    new Dimension( windowWidth + 10, windowHeight+10 ));
    // Add GUI components
    this.setLayout(new BorderLayout());
    this.add("Center", splitPane );
    } // constructor
    public static void main(String argv[])
    if (argv.length != 1) {
    System.err.println("Usage: java DomEcho filename");
    System.exit(1);
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    //factory.setValidating(true);
    //factory.setNamespaceAware(true);
    try {
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(argv[0]) );
    makeFrame();
    } catch (SAXException sxe) {
    // Error generated during parsing)
    Exception x = sxe;
    if (sxe.getException() != null)
    x = sxe.getException();
    x.printStackTrace();
    } catch (ParserConfigurationException pce) {
    // Parser with specified options can't be built
    pce.printStackTrace();
    } catch (IOException ioe) {
    // I/O error
    ioe.printStackTrace();
    } // main
    public static void makeFrame() {
    // Set up a GUI framework
    JFrame frame = new JFrame("DOM Echo");
    frame.addWindowListener(
    new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}
    // Set up the tree, the views, and display it all
    final DomEcho02 echoPanel =
    new DomEcho02();
    frame.getContentPane().add("Center", echoPanel );
    frame.pack();
    Dimension screenSize =
    Toolkit.getDefaultToolkit().getScreenSize();
    int w = windowWidth + 10;
    int h = windowHeight + 10;
    frame.setLocation(screenSize.width/3 - w/2,
    screenSize.height/2 - h/2);
    frame.setSize(w, h);
    frame.setVisible(true);
    } // makeFrame
    // An array of names for DOM node-types
    // (Array indexes = nodeType() values.)
    static final String[] typeName = {
    "none",
    "Element",
    "Attr",
    "Text",
    "CDATA",
    "EntityRef",
    "Entity",
    "ProcInstr",
    "Comment",
    "Document",
    "DocType",
    "DocFragment",
    "Notation",
    // This class wraps a DOM node and returns the text we want to
    // display in the tree. It also returns children, index values,
    // and child counts.
    public class AdapterNode
    org.w3c.dom.Node domNode;
    // Construct an Adapter node from a DOM node
    public AdapterNode(org.w3c.dom.Node node) {
    domNode = node;
    // Return a string that identifies this node in the tree
    // *** Refer to table at top of org.w3c.dom.Node ***
    public String toString() {
    String s = typeName[domNode.getNodeType()];
    String nodeName = domNode.getNodeName();
    if (! nodeName.startsWith("#")) {
    s += ": " + nodeName;
    if (domNode.getNodeValue() != null) {
    if (s.startsWith("ProcInstr"))
    s += ", ";
    else
    s += ": ";
    // Trim the value to get rid of NL's at the front
    String t = domNode.getNodeValue().trim();
    int x = t.indexOf("\n");
    if (x >= 0) t = t.substring(0, x);
    s += t;
    return s;
    * Return children, index, and count values
    public int index(AdapterNode child) {
    //System.err.println("Looking for index of " + child);
    int count = childCount();
    for (int i=0; i<count; i++) {
    AdapterNode n = this.child(i);
    if (child.domNode == n.domNode) return i;
    return -1; // Should never get here.
    public AdapterNode child(int searchIndex) {
    //Note: JTree index is zero-based.
    org.w3c.dom.Node node =
    domNode.getChildNodes().item(searchIndex);
    return new AdapterNode(node);
    public int childCount() {
    return domNode.getChildNodes().getLength();
    // This adapter converts the current Document (a DOM) into
    // a JTree model.
    public class DomToTreeModelAdapter
    implements javax.swing.tree.TreeModel
    // Basic TreeModel operations
    public Object getRoot() {
    //System.err.println("Returning root: " +document);
    return new AdapterNode(document);
    public boolean isLeaf(Object aNode) {
    // Determines whether the icon shows up to the left.
    // Return true for any node with no children
    AdapterNode node = (AdapterNode) aNode;
    if (node.childCount() > 0) return false;
    return true;
    public int getChildCount(Object parent) {
    AdapterNode node = (AdapterNode) parent;
    return node.childCount();
    public Object getChild(Object parent, int index) {
    AdapterNode node = (AdapterNode) parent;
    return node.child(index);
    public int getIndexOfChild(Object parent, Object child) {
    AdapterNode node = (AdapterNode) parent;
    return node.index((AdapterNode) child);
    public void valueForPathChanged(TreePath path, Object newValue) {
    // Null. We won't be making changes in the GUI
    // If we did, we would ensure the new value was really new,
    // adjust the model, and then fire a TreeNodesChanged event.
    * Use these methods to add and remove event listeners.
    * (Needed to satisfy TreeModel interface, but not used.)
    private Vector listenerList = new Vector();
    public void addTreeModelListener(TreeModelListener listener) {
    if ( listener != null
    && ! listenerList.contains( listener ) ) {
    listenerList.addElement( listener );
    public void removeTreeModelListener(TreeModelListener listener) {
    if ( listener != null ) {
    listenerList.removeElement( listener );
    // Note: Since XML works with 1.1, this example uses Vector.
    // If coding for 1.2 or later, though, I'd use this instead:
    // private List listenerList = new LinkedList();
    // The operations on the List are then add(), remove() and
    // iteration, via:
    // Iterator it = listenerList.iterator();
    // while ( it.hasNext() ) {
    // TreeModelListener listener = (TreeModelListener) it.next();
    * Invoke these methods to inform listeners of changes.
    * (Not needed for this example.)
    * Methods taken from TreeModelSupport class described at
    * http://java.sun.com/products/jfc/tsc/articles/jtree/index.html
    * That architecture (produced by Tom Santos and Steve Wilson)
    * is more elegant. I just hacked 'em in here so they are
    * immediately at hand.
    public void fireTreeNodesChanged( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesChanged( e );
    public void fireTreeNodesInserted( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesInserted( e );
    public void fireTreeNodesRemoved( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesRemoved( e );
    public void fireTreeStructureChanged( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeStructureChanged( e );
    }

    DocumentBuilderFactory can be configured to ignore white space.
    http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#setIgnoringElementContentWhitespace(boolean)

  • Most efficient way to apply Paragraph Style A to Paragraph style B?

    I'm looking for the most efficient way to all
    all aspects of an existing named paragraph style "A" to another named paragraph style "B". I'd especially like to find a keyboard-only way to do this.
    To my surprise,
    Copy Special >
    Paste doesn't seem to copy tab settings...(?) This leads me to suppose that other aspects of the source p'style may not be crossing the Great Paste Divide.
    Over the years I've used a variety of more or less clumsy multi-step, multi-tool "tricks" (including third-party plug-ins) to apply one named paragraph style to another, but knowing FrameMaker as I do I suspect there may be a truly efficient way to do what I want.
    Is there?
    Cheers & thanks,
    Riley

    Arnis:
    8.0p277.
    The Font family and style got Pasted -- that was immediately apparent. And based on all I know about F'Maker, I would've thought the tabs would go over.
    But when I opened the target p'style the Tabs area was completely blank.
    I'm not sure if anything else wasn't making it 'cross the Paste Divide: Once the Tabs weren't Pasted, I fell back to a different, brute-force strategy simply to get around the problem and return to work...
    Moreover, since the structured templates I inherited for this project are full of idiosyncrasies, I'll just file this one away under "The Templates Did It" and hope for better luck the next time I try the Copy Special thing...
    Cheers & thanks for your help,
    Riley

Maybe you are looking for