Help please on Observer / Observable and Serial Communications!

Help!
I have a project where I need a java application to talk to some test equipment via the serial port. I have studied the java comm api and played around with the SerialDemo example which I used to model my code.
I have a SeialConnection class which is very similar to the example except I made it to extend Observable and I have it notify observers when data is detected on the serial port.
I created a second class which extends Obserable which communicates with the SerialConnection and implemented the observer interface. This class process the incomming and outgoing data and provides some higher level methods, like getSerialNumber(), for my application to use. The application frame is an Observer of this class so the GUI can show the status as well.
An example method from this class:
private String Get590AROMString() {
SendString("EZR-V"); //Send a command to the s.p.
serialConnection.pause(750); //Basically a sleep(750)
return ROMVersion; //Return the data from update()
Excerpt from update method:
// If return from serialConnection starts with VER: parse the RV and SN.
if(T.startsWith("VER:")) {
ROMVersion = new String(T.substring(0,T.indexOf('~')));
SpeciesName = new String(T.substring(T.indexOf('~')+2));
return;
This works great when the test equipment sends a message or when the user selects a command from the program interface. My problem is when I try to send a command to the serial port from within the update method of the observer. There are instances where a result from the serial port needs to initiate another request for information.
Here is a fragment from the update method of the application frame:
public void update(Observable obs, Object obj) {
DensTalkStatus DTS;
if( obs==DT ) {
DTS = (DensTalkStatus)obj;
else if(DTS.GetStatus()==DensTalkStatus.NOTIFY_ZEROOK) {
if(FIRSTCONNECT590A) {
GDD.GetDensimeterInfo(); // *** This is the Request
GDD.SetDensID(EDM);
FIRSTCONNECT590A = false;
When I make a request for additional information from the serial port within the update method I get nothing returned and the requested data arrives later after the update method has completed.
I do not know the fine details of how the javax.comm or observer/obserable works but it appears to me that my strategy can only process one command at a time.
Can anyone think of a way to allow the application's frame update method to request information and wait for the data to be ready?
Does anybody have an example of how to do this type of communications?
I am sorry for the length of this question... Thank you for your time.
Doug

I have not received any suggestions yet on an alternate method for this problem, but I have come up with a solution I think will work. I am posting it here so others who have the same problem can at least see what path I followed...
The basic problem seems to be that I am trying to have my observer ask for information that requires the same observer / observable thread to respond.. duh! :) To requst additional information from the serial port I need to move the requests out of the update() method to a different thread.
I implemented the SerialWorker class to make the request so the observer update() method could return normally without waiting for the result of the new request.
Doug

Similar Messages

  • Some help please navigating these forums and a little discussion as well?

    There are a few questions I’d like to post, but first I need to determine how to use this newer style of user-to-user forum. Yeah, it’s been around a few years or so, but I’ve seen it take over the more traditional message board systems like v-bulletin and phpBB. Those boards were easy to navigate, as the forums, categories and topics were presented in a typical directory tree structure (even though the built-in search functions leaved a lot to be desired).
    Now the trend has shifted to formats such as this. While some retain some semblance of categories and topics (discussions), others seem to abandon this altogether in favor posts or discussions being related via tags or keywords. Google is the worst offender – forcing the user to select up to 4 pre-defined descriptors when creating a new post.
    Also confusing is how the terminology has changed. The forums are now calling topics, discussions. But they end up containing even less actual discussion on the topic and have de-volved into simple questions and answered. This is reinforced by the use of buttons to compel the original poster to designate responses as helpful or correct answers. This I would guess is in response to the myriad of answer seekers posting questions, receiving several helpful replies and never going back to say thanks, thus, the threads become all but useless for others who experience and seek out solutions to similar issues.
    The new format also usually starts out with “ask your question here” which is just another way to say, “hey, how about at least giving the search a try before asking a question that’s been covered before”.  Because many self-contained search features just don’t work, I can see why users just skip over it. But, what they may not know is that you can use Google to search a specific site. Forum, or blog which usually works pretty well. I’ve done this on a number of occasions, only to find the response as “this question has been answered here a hundred times – try searching”. If the responder is feeling generous that day, he or she may also present a link – a google search link that includes keywords.
    So, here I do see the initial ask your question box, then underneath that, a bunch of icons that represent particular products/topics. I start searches using more keywords, the reduce them If there are too many results. This gradual decline works well for Google, but here at Apple Support, I went from over 700 results to just two by eliminating all but the two mandatory keywords. I will do some more searches and post in the appropriate section, but my gut reaction is that it would be hard to believe that I’m the only person who has ever had this question.
    So, then – what’s the best and right way to use this new forum?
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    A BRIEF HISTORY OF ONLINE MESSAGE BOARDS
    I’m turning the double-nickel this year, so I’ve earned the right to gripe a bit. I don’t know everything, but for those of you youngsters, do yourself a favor a read up. If you truly are a techno-phile, you’ll find it at least somewhat interesting, at least enough to do a little research. Plus, this information isn’t all that old.
    The first online community I was exposed to was the BBS – Bulletin Board System. I had just bought my first PC, a Tandy, and the sales guy sold me a modem and gave me a number to call to connect to his BBS. I installed the modem, dialed the number and for the first time heard the annoyingly beautiful sounds of modems connecting. The, almost like “Do you want to play a game?”, text appeared on my monitor and I was hooked. The BBSes were local – to avoid long distance calls – and operated by those who could afford a second, dedicated computer and phone line. Usually, only one person could connect at a time – browse the discussion topics, leave a post to add to the discussion, check private messages (email) then log off.
    News Groups were the next form on online interaction I was introduced to. These required a special server running a dedicated protocol and a new reader, usually integrated in with an email client like Outlook Express. Each group was a specific topic – for example, Microsoft groups may have had a couple dozen or so groups covering topics like Windows 95 or networking, other commercially sponsored groups, or self-created groups. Like a BBS, you would log on, catch up on unread messages, respond to some and move on. It was in the News Groups where I learned how to program web pages to connect to a hosted database and many other things, thanks to the expertise and kindness of strangers. These groups soon became the territory of spammers, not to mention the real ugly recesses of the internet – international folks sharing “content” that the work obscene can’t even begin to describe. ISP’s soon dropped news groups from their services and they went away.
    By this time however, the world-wide-web was now in full swing. We no longer needed AOL or Prodigy to get on the Net, just an ISP and browser. Broadband was becoming available in select markets. Web-based bulletin boards sprang up all over, filling the void that the news groups left behind. They evolved, but kept to the simple structure and format for a good long while. As the cost of web hosting came down, and the availability of online databases went up, and open source application became better and more robust, anyone could incorporate a forum into their site with little time or expense.
    Social Media was on the rise. Sites came and went. From Friendster, to Myspace, then finally facebook, Twitter and LinkedIn. The net also settled in to a short list of other content sharing sites – YouTube, Flickr, Instagram. These took over the social discussion aspects of the online forum sites. That left the forums to take the only remaining role of software and product support – both as an extension of a company’s support solution or user-to-user help and support.
    On more than one occasion, I’ve tried to engage other users in topical and conceptual discussion in these groups, but it seems that they’ve already used their energy for that keeping up with their social media obligations. Facebook groups get lost in the multitude of pages. So end user support groups have settled into Q & A, mark the answer as correct them move on. Then another person comes along with the same question, enters it into the box, sees the first ten “pertinent” results that don’t answer the question, posts the question, and the cycle continues.
    If anyone has read this far, I commend you! Reading is fast becoming a lost art. I know it’s hard to read off a computer screen, easier on a tablet. And while I live my gizmos and gadgets, I have to still at least once in a while pick up a real book. I’m perfectly satisfied with my iTunes system with the only issue being the quality of any downloaded music. It’s better than it used to be, but CD’s have superior sound. Blu-ray Disc has superior sound and picture.
    I did purchase several books from the iTunes Book Store. But why? I could have bought them anywhere and read them in iBooks, but not the other way around. I had to sell my iOS devices. And now I can’t read my books. But that’s another story, for another day.

    Slip Jigs
    Contributors here so far are the cream of the crop...
    As an overall reaction to your treatise, I agree. I also judge that you - like me - may have some experience and skill at UX design (User eXperience - usability design, for the unwashed masses).
    First, let me commend your use of the WHITE SPACE that Apple graphic designers have so kindly provided. Looks very much like a paper page full of easy-to-read-SERIF-FONT text - it is clear you have experience with design concepts.
    As a tribute, I will post in your style - although our compose pane here is not quite WYSIWYG, I am hoping that line spacing will sort itself out, if not I will remove my attempt at bucking the system - but it may time for you to get some new optics
    you said:
    " ... v-bulletin and phpBB. Those boards were easy to navigate, as the forums, categories and topics were presented in a typical directory tree structure... "
    Agree that vBulletin, etc. WERE easy and familiar - but what is this structure but lipstick on that pig - see SITEMAP | ASC  (tt2's excellent UserTip). The digital directory tree is merely an adaption of the familiar Fileroom of old... a room for files(computer), file cabinets w/ file 'folders'(folders) and files(files). Apple in the form of Jobs/Wozniak (actually Xerox, but I won't quibble) was groundbreaking in the introduction of the GUI to the masses. [see your comment on being forced to learn a new way of working... has always been thus]
    Let me add that the lack of Apple's implementation of the stock features of "Sticky" threads - Announcements, Hot Topics, etc., is a miscalculation. The CATEGORIES above the Using ASC list of threads - "Announcements" and "Community Events" - baffle me as to their usefulness as I can see neither when I click 'em, only some "filtering" of what is in the "Feedback about Discussions" (?Feedback ?about? Disscussions?) Category.
    you further said:
    "... the trend has shifted to formats such as this. While some retain some semblance of categories and topics (discussions), others seem to abandon this altogether in favor posts or discussions being related via tags or keywords... "
    Kids these days... => iDevices (generic for handheld smarty-devices of any stripe) are responsible for the VISUAL graphic design conventions... no more teensy-weensy cursor - but BIG FAT FINGERS.
    A good suggestion to submit at Support_Feedback  might be to improve the 'Smartness' of the search capabilities by REQUIRING tags to be attached by the OP (offer suggestions if they wish) AND FURTHER, allowing other users of status to ADD tags (see your ¶ #2) - my estimation of the ACTIVE SEARCH is that it is looking for matching terms in the title of a thread, but I have no proof - anecdotal or by documentation at JiveSoftware.
    additionally you said:
    "... the use of buttons to compel the original poster to designate responses as helpful or correct answers. This I would guess is in response to the myriad of answer seekers posting questions, receiving several helpful replies and never going back to say thanks, thus, the threads become all but useless for others who experience and seek out solutions to similar issues. "
    I have no experience with other enterprise solutions, but the scuttlebutt on Jive is that it is the best in the business at Community Collaborative WorkFlow Software for Big Enterprise. We here unfortunately have been given use of a mere pittance of Jive's features. Apparently the MARKUP buttons have a really valuable purpose in the complete package of Jive workflow management. Here, merely a system for rewarding helpers. The green icon goes un-noticed by most and the OPost is likely irrelevant to most individual's issue. Regarding the latter portion, you can't change human nature. Some folks just aren't team players.
    you continued:
    "... The new format also usually starts out with “ask your question here” which is just another way to say, “hey, how about at least giving the search a try before asking a question that’s been covered before”. Because many self-contained search features just don’t work, I can see why users just skip over it. But, what they may not know is that you can use Google to search a specific site. ... "
    This particular issue of "Why do folks not go to the dadgum forum related to their device/software?" has plagued me since actively taking part here. My maladies prompted ME to go directly to the forum/sub-forum where they belonged. Clearly "My iPhone is a BRICK - how do I UN-BRICK IT?" does not belong in this forum - Using ASC - but thousands of similar questions land here - it MAY be because the DEFAULT forum for un-PRE-visited forum at SUBMIT.
    The WELCOME page has the preferred path - a "Search or ask a question" field and the teeny -> New to the Community? Start Here.  link (actually Tutorials )
    -- neither of which content does anything to coach the new user in "How Do I Use This Joint?"
    Something akin to "Pick the Device or Software in which you are interested below" might at least get the visitor to the right place to BROWSE their issue. Many folks are unable to craft a TITLE to their question that even resembles their problem, much less explain it in the bodytext.
    This is explained  in the javascript:; link "How to write a good question"  - e content of which I leave open AND hi-lited in a text file ready to copy/paste, for example:
    Quoted from  Apple's "How to write a good question"
       To help other members answer your question, give as many details as you can.
    Include your product name and specs such as processor speed, memory, and storage capacity. Please do not include your Serial Number, IMEI, MEID, or other personal information.
    Provide the version numbers of your operating system and relevant applications, for example "iOS 6.0.3" or "iPhoto 9.1.2".
    Describe the problem, and include any details about what seems to cause it.
    List any troubleshooting steps you've already tried, or temporary fixes you've discovered.
    Here is how obscure that information is
    It's almost as if the confusion is by design.
    HOORAY! - another fan of the Google workaround. I get pooh-poohed by some for even suggesting going off the reservation, but it works WONDERFULLY and is FAST AS LIGHTNING with even more useful post-result filtering.
    you concluded your evaluation with:
    " So, then – what’s the best and right way to use this new forum? "
    Learn the system just like you did when you first started using a computer instead of paper. It is what it is. I have a comfortable WorkFlow established using browser bookmarks and Add-ons + Google for all searches + email notifications to sort the wheat from the chaff. Not adopted of my choosing... but at least it's MINE!! Be advised that the SiteWare employs some "we will save you from yourself, helmet-law-like features" that may frustrate you from time to time - until you discover (or are told) how to circumvent them.
    Some definitions:
    Apple Support Communities = Bulletin Board Software Site
    Community = Forum
    Category = Sub-Forum
    Question = Thread
    Reply = Reply
    Your not so "Brief History..." is clearly a good evaluation and Executive Summary. Are you SURE you're not an interactive developer?
    best regards
    CCC

  • TOSHIBA Please Read - Beta Testing and Developer Community

    Hello Jim,
    I wanted to respond to your posting about the status of the update but the thread has been locked, so I started a new one. Anyway, I was wondering if there was a chance that we could get a beta test version of the software provided to experienced and brave individuals that can report back to the dev team with various issues and bugs to be fixed?
    The public beta will not only appease the people angry at Toshiba for missing the deadline for the update, but also provide necessary feedback to the development team that can be used to create a more feature complete update. As an Android developer myself, I would take every oppurtunity to report bugs and issues and even provide code to help implement fixes for various issues if said source is availible. I believe it would be a great idea for Toshiba to create an open source development community on these forums and to provide us with bleeding edge code for us to implement and mess around with.
    Such communities already exist on various sites like XDA Developers but not with vendor support, if Toshiba provided a vendor-supported developer community around the Thrive and other Android devices such as the Excite and Folio. With a vendor supported community, we would have a place where Toshiba can make better software for the devices and developers and brave regular users can participate in the process of getting updates for our various devices. I believe that moving away from such a closed development environment would not only help Toshiba develop better devices and software, but also give the company a leg up on its competitors who do not have such a community pitching in allowing for better software to be coded.
    I hope that this message is read by someone at Toshiba that can make this happen, as the benefits are truly mutual, since Toshiba would be getting better software for its devices and developers get the resources and code needed to turn Toshiba into one of the best supporters of this great open-source project.
    If anyone from Toshiba would like to contact me to help coordinate such an undertaking, I may be reached at [email protected]
    Thank You For Your Time,
    Rob Gries
    Android Developer

    Hi Rob,
    Thanks for the thoughtful message. Your points are well made and, while I don't disagree that there are mutual benefits, Toshiba has no current plans for directly building or supporting a developer community.
    On the other hand, private beta testing for the Thrive product line was first launched last summer and I expect it to be ongoing as major software updates reach reasonably usable states within the development process. However, you won't see discussion of beta testing in the message boards because beta testers are under NDA.
    Thanks again for the thoughts and for your interest in developing for Thrive!
    Jim

  • Little help please regarding deleting files and folders...

    My wife has a MBP and has accumulated some old items in her documents folder that she'd like to delete. She has a USB mouse but the "right click" doesn't appear to work. She's running 10.4.11 and can't reveal the files in icon mode to facilitate dragging to trash. Certainly there is a sequence of keystroke commands that will allow these files to be effectively trashed, but our "control/delete", or "apple/delete", or "option/delete" doesn't do the trick after highlighting the subject file. Help please! TIA!

    To delete a file or folder, high light it then using the keyboard type Command Delete and that will delete it. If you have multiple files and/or folders the same keyboard commands apply.
    Regards,
    Roger

  • Help please - Updating .jar file and can't compile decompiled .java files.

    Ok, so there is a game on the internet called 'runescape', its a java applet that runs in the web browser from a cache in the windows directory.
    Basically im trying to edit this client so that i can run it away from their website (for use on a private server).
    The problem i am getting is that when i decompile the class files from the .jar into the .java files i can't recompile the .java files.
    E.G. I decompiled one of the .class files and tried to re-compile it agian straight away which brought me errors, i did this to rule out my editing as the problem.
    The jar file can be found [here.|http://world80.runescape.com/loader_gl397188536.jar] but the link will no double be dead after a few weeks.
    Can somebody please take a look and help me? I'm fairly new to java programming so if you could keep your answers as simple as possible that would be great, thanks.
    Ps. If this is the wrong section im sorry, i couldn't find the right section and this section seemed closest for me.

    i'm compiling using the javac command in a batch file, its displaying 100 errors but there are more, it seems to be showing that the syntax is incorrect as it is labeling brackets as being in the incorrect places.
    Decompiling error?
    As for being allowed to do this, im not so sure the company would approve but im only doing this for learning purposes and will not be releasing any of it upon the internet.

  • Help Please Software/Hardware Mouse And Keyboard problem.

    I have a Corsair Vengeance and a Razr Black widow keyboard and the problem is that when i right click it wont let me select any options, it will flicker violently only when i move the mouse and im getting strange yellow highlight boxes whenever i drag
    the left mouse button(ex Volume Sliders). The keyboard will only bring up shortcuts and the start button on my keyboard will open narrater settings. Ive noticed that it only happens when my computer falls asleep and when i turn it back on the problem will
    start. Ive just installed advanced system care and ive done he maintanence. Can that be the problem? Ive already uninstalled it but the problem keeps happening. 

    Try reinstalling the driver http://www.razerzone.com/au-en/gaming-keyboards-keypads/razer-blackwidow/
    Also run a "sfc /scannow" from the command prompt
    Also in advanced power management setting disable the USB power saving options (think its called USB hybrid power saving)
    Regards Jake Gardner If you found this post helpful, please give it a "Helpful" vote. If it answered your question, remember to mark it as an "Answer". This posting is provided "AS IS" with no warranties
    and confers no rights! Always test ANY suggestion in a test environment before implementing! Sorry if my grammar is incorrect as I am probably on writing to you from my phone.

  • HELP PLEASE! Face time and iMessage no longer work on my iPod touch 4th generation

    Everytime I get on Imessage it says that I need to sign in so I do then it says to hit verify that the email im using is the one thatll be for imessage so i do then it just sends me back to the sign in page I've tried rebooting it and everything someone please help??? ios6.1.6

    Try:
    If you get an error when trying to activate iMessage or FaceTime
    FaceTime, Game Center, Messages: Troubleshooting sign in issues

  • Help please on importing pics and Iphoto version

    Hello,
    I currently have Iphoto 6 (version 6.0.6) and I realized that when I want to import pictures it wont let me select the pictures I want only. it has been inport all them at once.
    Can I get a new version of Iphot without paying? and do these new versions let me select the epicures i want to download from my digital camera?
    Please help

    I currently have Iphoto 6 (version 6.0.6) and I realized that when I want to import pictures it wont let me select the pictures I want only. it has been inport all them at once.
    That is correct - however image capture in yoru applications folder supports selective photo loading to your computer - then you can import those photo into iPhoto
    Can I get a new version of Iphot without paying?
    No you have the latest version of iPhoto 6 - iPhoto '08 and iPhoto '09 are parts of iLife '08 and iLife '09 which are paid upgrades
    and do these new versions let me select the epicures i want to download from my digital camera?
    Yes - as does image capture which you already have
    LN

  • Multithreaded analog input and output and serial communication during the AIAO

    I need to read in analog data on 4 channels (4000 scans/s on each channel for a total of 250ms) and while this is happening send out two signals: A trigger pulse (which I currently send on an analog channel, using channel DAC0OUT) and two ascii commands using the serial port. My problem is that the data acquisition VI I am using is a blocking VI, it runs to completion before allowing the two signals to be sent. I am using the VI titled, "AI Acquire Waveforms (scaled array).vi" I don't need to look at the acquired data until after the whole operation is complete. Any help anyone can offer would be much appreciated.

    Hello Mark,
    The AI Read VI will block other operations when waiting for data. I would suggest to reduce the number of scans to read (this is an input for the AI Read VI) to help with handling multiple operations simultaneously. By reducing the number of scans to read by the AI Read VI, it won't have to wait for the whole buffer to be read in before "unlocking" the CPU for other operations. You could place the AI Read in a loop and acquire smaller chunks of the data at a time. For instance, your buffer size is probably 1000. Instead of calling the AI Read VI once and waiting for all 1000 scans, you could place the AI Read in a for loop and acquire 200 scans at a time (have the for loop run 5 times).
    Or you could set up the AI Read VI to read 0 scans the fir
    st time and then just read whatever is in the backlog on subsequent calls. There is a backlog output to AI Read; you could use this with a shift register within a loop to read only the data that is already in the buffer. For both of these cases, I would place a wait in the loop (25-100 ms) to give the CPU time to do other things.
    Another method is to use an occurrence. Place the Functions >> DAQ >> Misc >> Set DAQ Occurrence.vi on your block diagram and set the "DAQ Event" input to "Fire every n scans" (the actual string is a little different). Then put in a Wait on Occurrence function (Functions >> Advanced >> Synchronization >> Occurrence) When you use an occurrence, you are waiting for the driver to tell you when the data is acquired, rather than constantly querying the driver, so it is much faster.
    One of these suggestions should help.
    Let me know if you have any additional questions.
    Regards,
    Todd D.
    NI Applications Engineer

  • Help please! Java application and web application...

    Hi,
    I have a problem with inserting a java application (Main.java) in a web application(index.jsp).
    I found a source demo of a drag and drop application on the Internet, but now I want to
    have the drag and drop application work in a Jpanel/JFrame in a webapplication.
    The drag and drop application code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class Main {
        public static void main(final String[] args) {
            final ButtonGroup grp = new ButtonGroup();
            final JPanel palette = new JPanel(new FlowLayout(FlowLayout.LEFT));
            palette.setBorder(BorderFactory.createTitledBorder("Palette"));
            final MainPanel mainPanel = new MainPanel();
            mainPanel.setPalette(palette);
            for(int j=0; j<4; j++){
                final JToggleButton btn = new JToggleButton("Panel "+(j+1));
                palette.add(btn);
                grp.add(btn);
                btn.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        mainPanel.setAdding(btn.getText());
            final JFrame f = new JFrame("Drag and drop panels");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(palette, BorderLayout.WEST);
            f.getContentPane().add(mainPanel, BorderLayout.CENTER);
            f.setSize(800, 600);
            f.setVisible(true);
    class MainPanel extends JPanel implements MouseListener, MouseMotionListener {
        private JPanel palette;
        private String adding="";
        private SubPanel hitPanel;
        private int deltaX, deltaY, oldX, oldY;
        private final int TOL = 4;  //tolerance
        public MainPanel() {
            setLayout(null);
            addMouseListener(this);
            addMouseMotionListener(this);
        public void mousePressed(final MouseEvent e) {
            if( adding != "" ){
                setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                SubPanel sub = new SubPanel(adding);
                add(sub);
                sub.setSize(sub.getPreferredSize());
                sub.setLocation((int)e.getX(),(int)e.getY());
                revalidate();
                adding = "";
                return;
            Component c = getComponentAt(e.getPoint());
            if (c instanceof SubPanel) {
                hitPanel = (SubPanel) c;
                oldX = hitPanel.getX();
                oldY = hitPanel.getY();
                deltaX = e.getX() - oldX;
                deltaY = e.getY() - oldY;
                if( oldX < e.getX()-TOL ) oldX += hitPanel.getWidth();
                if( oldY < e.getY()-TOL ) oldY += hitPanel.getHeight();
        public void mouseDragged(final MouseEvent e) {
            if (hitPanel != null) {
                int xH = hitPanel.getX();
                int yH = hitPanel.getY();
                int xDiff = e.getX()-oldX;
                int yDiff = e.getY()-oldY;
                int cursorType = hitPanel.getCursor().getType();
                if( cursorType == Cursor.W_RESIZE_CURSOR){           //West resizing
                    hitPanel.setBounds( e.getX(), yH, hitPanel.getWidth() - xDiff, hitPanel.getHeight() );
                }else if( cursorType == Cursor.N_RESIZE_CURSOR){     //North resizing
                    hitPanel.setBounds( xH, e.getY(), hitPanel.getWidth(), hitPanel.getHeight() - yDiff );
                }else if( cursorType == Cursor.S_RESIZE_CURSOR){     //South resizing
                    hitPanel.setSize( hitPanel.getWidth(), hitPanel.getHeight() + yDiff );
                }else if( cursorType == Cursor.E_RESIZE_CURSOR){     //East resizing
                    hitPanel.setSize( hitPanel.getWidth() + xDiff, hitPanel.getHeight() );
                }else if( cursorType == Cursor.NW_RESIZE_CURSOR){     //NorthWest resizing
                    hitPanel.setBounds( e.getX(), e.getY(), hitPanel.getWidth() - xDiff, hitPanel.getHeight() - yDiff );
                }else if( cursorType == Cursor.NE_RESIZE_CURSOR){     //NorthEast resizing
                    hitPanel.setBounds( xH, e.getY(), hitPanel.getWidth() + xDiff, hitPanel.getHeight() - yDiff );
                }else if( cursorType == Cursor.SW_RESIZE_CURSOR){     //SouthWest resizing
                    hitPanel.setBounds( e.getX(), yH, hitPanel.getWidth() - xDiff, hitPanel.getHeight() + yDiff );
                }else if( cursorType == Cursor.SE_RESIZE_CURSOR){     //SouthEast resizing
                    hitPanel.setBounds( xH, yH, hitPanel.getWidth() + xDiff, hitPanel.getHeight() + yDiff );
                }else{      //moving subpanel
                    hitPanel.setLocation( e.getX()-deltaX, e.getY()-deltaY );
                oldX = e.getX();
                oldY = e.getY();
        public void mouseMoved(final MouseEvent e) {
            Component c = getComponentAt(e.getPoint());
            if (c instanceof SubPanel) {
                int x  = e.getX();
                int y  = e.getY();
                int xC = c.getX();
                int yC = c.getY();
                int w  = c.getWidth();
                int h  = c.getHeight();
                if(       y >= yC-TOL   && y <= yC+TOL && x >= xC-TOL   && x <= xC+TOL  ){
                    c.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
                }else if( y >= yC-TOL   && y <= yC+TOL && x >= xC-TOL+w && x <= xC+TOL+w ){
                    c.setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
                }else if( y >= yC-TOL+h && y <= yC+TOL+h && x >= xC-TOL   && x <= xC+TOL ){
                    c.setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
                }else if( y >= yC-TOL+h && y <= yC+TOL+h && x >= xC-TOL+w && x <= xC+TOL+w ){
                    c.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
                }else if( x >= xC-TOL   && x <= xC+TOL ){
                    c.setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
                }else if( y >= yC-TOL   && y <= yC+TOL ){
                    c.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
                }else if( x >= xC-TOL+w && x <= xC+TOL+w ){
                    c.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
                }else if( y >= yC-TOL+h && y <= yC+TOL+h ){
                    c.setCursor(new Cursor(Cursor.S_RESIZE_CURSOR));
                }else{
                    c.setCursor(new Cursor(Cursor.MOVE_CURSOR));
        public void mouseReleased(final MouseEvent e) { hitPanel = null; }
        public void mouseClicked(final MouseEvent e) {}
        public void mouseEntered(final MouseEvent e) {}
        public void mouseExited(final MouseEvent e) {}
        public void setAdding(final String string) {
            adding = string;
            setCursor(new Cursor(Cursor.HAND_CURSOR));
        public void setPalette(final JPanel panel) { palette = panel; }
    class SubPanel extends JPanel {
        public SubPanel(final String name) {
            setPreferredSize(new Dimension(100, 100));
            setBorder(new TitledBorder(new LineBorder(Color.BLACK), name));
    }This application works with JFrame, but I want to display the JFrame in a webapplication (JSP Page).
    I'm using Netbeans 6.0 (GlassFish) to create webapplication using Visual Web JavaServer Faces.
    So in summary:
    How can i display the drag and drop application into a JFrame (better in a JPanel) in a webapplication (index.jsp)??
    Hope you can help...
    Thanks in advance...
    Greetings,
    Rajsh

    So have an applet that opens a JFrame... JSP or not has nothing to do with it, since it's nothing but HTML the client gets.
    You can't have a JFrame embedded in an HTML page. And if you could have an applet but don't know how to get that copied code to fit inside (I mean, content pane is content pane), you might want to consider learning how to do that.

  • Help please - have a Nano and a Shuffle and neither are working! The Nano wheel appears to have stopped working - I can't get it to do anything. I've done the reset,it worked the first time but not since. And the shuffle won't sync with my library!

    Hi,
    I have an iPod shuffle 4th generation and an iPod Nano 5th generation . The Nano wheel appears to have stopped working - I can't get it to play or anything. I've done the reset and it worked the first time, but now the only way I can get it to play anything is to shake it and go with the shuffle choices - I can't change volume, song, pause or turn it off.
    So, I decided to start using the Shuffle which I was given as a present last year. I've plugged it into my laptop (running windows 8 and newest version of iTunes). It appears in iTunes on the left hand side, but when I click to sync (whether I tick sync all or choose artists) it says synched but has no music. It seems to not be linked to the music library - when I tick synch all songs, next to the "sync music" it says 0 songs?
    Any help to fix either would be really appreciated - I'm without any music at the moment and I'm going away this weekend!
    Thanks

    Hi Bblairjones,
    If you are having issues with your Nano and Shuffle, you may want to try the Troubleshooting Assistants on the following page:
    Apple Support: iPod Troubleshooting Assistants
    http://www.apple.com/support/ipod/five_rs/
    Regards,
    - Brenden

  • Need some help please, itunes 7.1 and Windows Vista

    Hello,
    I've got a bit of a problem here with itunes and my ipod nano.
    Basically I'm using Windows Vista Ultimate 32bit and when I connect my ipod to my PC the found new hardware wizard pops up but can never find the ipod nano.
    In disk management the ipod is showing up but in itunes its not.
    Could anyone advise on this please?

    A little update about this issue and it's good news. I've managed to get the ipod show up in disk management with the ipods name and when I open itunes and plug the ipod in, it pops up in itunes.
    Heres it is just like it should be, a result!
    http://img291.imageshack.us/img291/1293/untitled1ln0.jpg
    Basically what I did to fix this issue in Windows Vista was the following
    1.Click Start type run in the search bar and then msconfig.
    2.Click on the Services tab and "hide all Microsoft Services".
    3.Click Disable All for all the non Microsoft services that are showing.
    4.Click OK
    5.Click Restart.
    6.When your desk top loads up click OK for the msconfig menu which pops up.
    7.Open itunes and connect your ipod.
    It should now show it does for me.
    Now follow step 1 again and load all services as your pc would start normally again and reboot, again your ipod should show up now as it should.
    I hope that's useful if anyone else experiences the same.

  • HELP PLEASE! I have and still get thousands of emails from apple communities support???!!!

    Hi There
    This is the third Message I sent to warn All the Apple Communities Support that everybody of them is SENDING ME AN EMAIL I've NEVER ask for!!!
    IS IS A HUGE BLOW TO MY HOTMAIL ACCOUNT! I have a message or 5 messages in one evert 2 to 5 minutes max! My hotmail account will just explode!
    I should ask you in first place to help me, and will see with Microsoft and hotmail to stop this hemorrhage!!!
    When I first login, I saw a message saying :
    Apple communities support in Korea page??!! I don't get this where come from? That's the only weird thing I saw!
    Kind regards

    Go to your profile page.
    Select the Notifications tab clear out anything that shows there.
    Go back to your profile
    In the Actions box select Preferences
    Select the Email Notifications Preferences tab
    Set the values as you like
    Go back to your profile
    In the Actions box select Manage Email Notifications
    delete any that show
    that should do it

  • Help please with Palm Address and Memo Files

    Hello.. I am new to this board, but perhaps someone can help me. 
    I have a PalmOne Zire 31 and have used it for years.  Primarily I used the Desktop verision on my laptop.  Well, my laptop died and was recently replaced.  Fortunately, as it was on it's last leg, I backed up the files onto a safe location.  And through the process, the handheld lost power do the data that was once there is gone.
    WHen I got the new laptop, I reinstalled the Software, and it opened OK.  However, when I moved the address info into the folder, the desktop won't open and I am getting an error message saying that it couldn't open the address info.  
    Any idea as to how to either get this data in, or how to convert the data to a txt or some type of file that I can read so that I can capture some important information?
    Thanks in advance.
    Bob

    Unbelievable .... after several hours of re-capturing to 2nd drive, my 1st drive sprung into life AND my 2nd drive failed in the same way, (repetitive clicking and not seen on the desktop.) WHAT'S HAPPENING TO ME!!!!!?????? I've swapped drives, cables, f/w ports and both discs behave badly when disconnected from my MBP so can't imagine both problems having same cause. Utterly baffled except that it happened after a long hard edit session with drives powered up for 24 hours or so.
    Anyway thanks for the suggestion I'll do some experiments for next time, shouldn't be long with Lacie drives. What you're suggesting then is that even though the media IS offline I need to TELL FCP its gone. What's the difference between deleting a clip from the browser and telling FCP to make it off-line. When I had the problem I already had a red stripe so I don't know whether the make offline thing would already be greyed out.

  • Help please, class starts yesterday, and I need to know if Lr 5.6 64 bit can be reset to "like new" or default. Like it's never been used!

      Hello, I need to know if it is possible to reset Lr 5.6 64 bit to default or like it was when I first downloaded it. Clean/empty/fresh. As an online college student, and using Lr for a while now, without being "Detailed Oriented," and "Methodic", I have a very messy and unorganized workflow. I am about to begin Digital Image Management, so a "like new" Lr, would help me tremendously! Thanks in advance for any help offered!

    File->New Catalog

Maybe you are looking for

  • Issue - Cannot open pdf in minimized mode in 8.1.0

    Hi All, We have an application that needs users to select the docs they would like to print and they can specify the number of copies too. Here, we need the ability to open a PDF file in minimized mode, print it and close it. We were able to do this

  • Removing disk from a volume storage space 2012 r2

    Hi, I've got a issue, here's my situation, i'm using storage space on a windows server 2012 R2 for my backups. Fisrt I had 14 3tb disk in mirror so there was 19tb usable for date. Now I needed more space so I just added 14 more disk and I extended th

  • Problems with scrolling after mountain lion download.

    I just downloaded mountain lion today and ever since the download I am having issues with the scrolling for my magic mouse and trackpad. My problem is when I scroll down on my mouse or trackpad it actually goes up on the page and vice versa. I have s

  • Keypad+Scroll wheel not working(kinda)

    I have a similar error to the one posted here:http://supportforums.blackberry.com/t5/BlackBerry-Curve-BlackBerry-8300/buttons-not-working/td-p/167... The whole of my 3rd row of button (zx789del) do not work by themselves,however when pressed in conju

  • BEx variable input value

    Hi, I have created a BEx Query, now based on selection screen inputs. Selection Screen Inputs: MATNR - PLANT- SLEVEL-(User Input Value) Mandatory Now when i select inputs at the time of running query eg; MATNR - 'ABC' PLANT-'A123' SLEVEL-'0.55' (User