Is it possible to integrate a SWING object into JavaFX?

Hi,
I created a program which measures some values and displays these in a JavaFX chart. Unfortunately after adding about 200 data points the application freezes. I think the problem is the chart, which seems not to be designed for realtime charts. I would like to use the the realtime chart from jvisualvm, but I have no idea how to integrate the chart in the JavaFX application.
I appreciate any help.

I created a program which measures some values and displays these in a JavaFX chart. Unfortunately after adding about 200 data points the application freezes. I think the problem is the chart, which seems not to be designed for realtime charts.JavaFX charts are designed for realtime charts. See the Advanced charts section in the Ensemble application. The application provides executable examples with source code for displaying chart data in JavaFX. The chart data in the samples is modified in realtime, features many datapoints and executes with fluently at high speed.
http://www.oracle.com/technetwork/java/javafx/samples/index.html

Similar Messages

  • How to embed swing component into javaFX ?

    Maybe I missed sth, but can someone explain us how can we embed swing component into javaFX 2.0 ?
    This was previously handled with javaFX "srcipt", why can't we do it anymore ?
    As far as the work to migrate from 1.3 to 2.0 is hard and huge, why do fx2.0 do not offer such feature anymore ? :(
    I know that ThingFx project try to cope with, but the current code doesn't match with my needs.
    Thanks for help,
    Edited by: tibO on 23 nov. 2011 14:35

    I know this post is old and the original authors might not even ben active; but it essentiall gets to the heart of what I'm trying to.
    I have a JDialogBox. In it I have a panel (which I have to change to a JScrollPane). Inside the JPanel I have a JLabel and a JTextArea.
    I was told to; make it scrollable in the event that there is too much info for the JDialogBox and to add HTML formatting (simple stuff like bold and colors.
    1) The JScrollBar doesn't seem to produce the scroll side bars.
    2) I must not be implementing the JEditorPane correctly. I just substituted JEditorPane for JTextArea in my code and it returned a type converstion error. Is JEditorPane even the correct object to use? Should I be using JTextPane?
    The reason I can't do this on a JLabel by JLabel basis is because I don't know how many labels I will need at each runtime. And I also have to have a swingtimer on it. I could create an array and loop around it to create the JLabels. But it seems a waste of commuting cycles. This is no good?

  • Is it possible to integrate Oracle intermedia search into apex ?(1)

    Or do something similar manually yourself in oracle xe ?(2)
    (1)I've been reading through part of the documentation of the intermedia search, and find it quite intresting. Better to use that if one can, then to have to do that it manually or yourself. But all I read is about JSP and PSP, and I guess PSP's are used by apex, but I was wondering if there was any way, to integrate intermedia search into apex, so that one can lookup say mp3, video files and images and display them in apex as well. Images may take some work but would I suppose be possible.
    However for the other two you need also player software to play both of them. As far as I know this is not integrated into Apex, but could possibly be provided by using the player integrated with a webbrowser, and by linking it to apex. So the browser is launched and plays the video or the audio file or alternatively a player is launched that allows to do that. But correct me if I'm wrong.
    (2) Alternatively I was wondering if one could do this, manually in Oracle XE, but then manually, by making tables with blobs and putting the files in there, and then finding somehow a way to get them played by a player, or to have them be put in a directory, and/or erased from that directory, and modify the player, or let it be activated and controlled by some kind of script to look for new files, and then play them off . Could this be done, by adding a parameter new_file_to_play to a message passed to the player, or the program governing the players behavior ?
    I know this sound difficult, and it probably is, but it would have its benefits. I suppose a simple answer would by, why not use oracle 10g with intermedia search ? Well because although I expect this to be the preferable choice, the license is rather expensive for me, and if I could get a rudimentary version working on XE, even having to do it myself, and writing the code as well,
    it would be ok.
    I just wonder could one not, make a table, with a nr, a blob, and then the specific fields for the specific information of that type, and then use a extraction program that extracts that information from a file, and puts it in a xml or csv file, so that say after the images were uploaded, one can load the details in as well ?
    It is more work, more complicated, and not as easy to use, but it could work I suppose.
    Any comments are welcome.
    Best Regards,
    Floris

    You should be able to add a menu option to Oracle E-Business Suite that just calls out to the URL of your ADF 11g application.
    http://knol.google.com/k/andy-pellew/creating-new-menu-items-in-oracle-e/v4b5tu39zysj/17#

  • Embedding Swing Components within Javafx Scene (on a Mac)

    Currently I trying to embed swing components into javafx through steps located here: SwingNode The Myth not the reality | In-SideFX
    Was able to get it working on a PC, however when the packaged jar is run on a mac, I end up with the "Headless exception"
    "Process manager already initialized: can't fully enable headless mode." (error attached below)
    Currently using java 7 update 51, using java 8 is not an option unfortunately.
    Does anyone know of a work around to get this working in mac or possibly point me in the right direction?
    Please let me know if providing other things would help. Thank you in advanced!

    Currently I trying to embed swing components into javafx through steps located here: SwingNode The Myth not the reality | In-SideFX
    Was able to get it working on a PC, however when the packaged jar is run on a mac, I end up with the "Headless exception"
    "Process manager already initialized: can't fully enable headless mode." (error attached below)
    Currently using java 7 update 51, using java 8 is not an option unfortunately.
    Does anyone know of a work around to get this working in mac or possibly point me in the right direction?
    Please let me know if providing other things would help. Thank you in advanced!

  • Muliple Geometry Objects into a Single geometry

    Hello,
    Is it possible to store multiple geometry objects into one geometry. ie I am having an ARC and SHAPE geometry , I need to combine these geometries into one geometry .
    So that the geomtry which I have created is a container for ARC and SHAPE.
    Thanks in Advance
    Senthil

    Hi Senthil,
    I am confused a little by your terminology, so I will try to answer as best I can.
    A single geometry can be made from multiple elements.
    The elements that make up the geometry can be all the same kind (points, lines, polygons).
    The elements that make up the geometry can be heterogeneous (points and lines, lines and polygons, polygons and points, points lines and polygons). These are known as heterogeneous collections (sdo_gtype 2004 if 2 dimensional).

  • How to turn a black object into white on an image?

    Hi,
    on a picture. i can turn a blue object into yellow, green or any other color. and vice versa.
    To do that i know 5 different ways, or combination of those methods.
    1- Hue/Saturation
    2- Color Balance
    3- Selective Color
    4- Replece Color (Similar to Hue/Saturation)
    5- select the area, create a new layer, paint the selected area on new layer, blend the new layer with "linear burn".
    but when it comes to black, i can't change the black to another color with any of the ways above. So i was wondering if it is possible to turn a black object into white without killing the texture. Or cleaning the object from colors, making it colorless.
    best way i know so far is playing with "exposure" settings. but this time the objcet on the image is becoming blure and loosing its texture.
    Here is the object i m trying to make white (or colorless). Do you know any way to do it?
    i need to make that shoe as white/colorless as this one below.
    Thanks!

    Thanks for your help. But i wish it was that easy
    i can simply select the whole shoe and do ctrl+i (short cut to invert) to invert the dark colors to white. But while it turns the dark colors into white it also turns white parts into black. which i don't want to.
    it doesnt have to be plain white, i need it to be as white as possible then i can use it as a template to try different colors on it. (like the second photo i sent)
    If i do it with "invert" the when i paint it the shoe doesnt look real, its because with "invert" option, light parts becomming shadow, and shaddows becoming light.

  • Swing objects invisible in JApplet

    My JApplet:
    public class applet extends JApplet {
    public void init() {
    setBackground(new Color(248,248,170));
    getContentPane().add(createPanel());
    For adding an object to a JApplet I have to use the getContentPane() command, but then the object is drawn behind the background and invisible. If I put this command right before the setBackground(..) too, the background is invisible either.
    If I use an Applet instead of the JApplet and add the panel, it works but its Swing-objects like lists,... don't popup, so I have to use the JApplet.
    What can I do?
    Thanks for advices.
    Robert

    You probably should change the background of the contentPane, not the JApplet. Change it to this:
    getContentPane().setBackground(new Color(248,248,170));
    getContentPane().add(createPanel());Not sure if that's the problem, but possibly.

  • Is it Possible to Combine Hibernate + Swing?????

    Hi Xperts,
    Is it possible to combine Hibernate + Swing?
    (My Point of View Hibernate Contains Transaction, Session... But In Swing Session??????)
    So i have lot of confusions.
    SO
    if Hibernate + Swing
    IF YES. HOW? ELSE TELL THE REASON.
    I EAGERLY WAITING FOR YOUR REPLY
    Thanks
    Edward and Hari

    Hi Duffymo - thanks for responding. It's fun to discuss this with somebody; I don't usually get many reasonable/friendly responses on the Hibernate user forum.
    What I mean by transaction based identity is thatin
    the normal, recommended Hibernate process (one
    session per transaction), objects fetched in
    different transactions do not == each other. Solet's
    say I do the following:
    * Start session 1 and transaction 1, fetch object
    with primary key 5, and store it in variable obj1.
    Commit transaction 1 and close session 1.
    * Start session 2 and transaction 2, fetch object
    with primary key 5, and store it in variable obj2.
    Commit transaction 2 and close session 2.
    * At this point, even though they represent thesame
    row in the database, obj1 != obj2. I'll assume you mean !obj1.equals(obj2)here, because [obj1 != obj2[/code] even without
    Hibernate if the two references point to different
    locations in memory in the same JVM. The equals
    method can be overridden. You can decide to check
    equality only examining the primary keys, or you can
    do a field by field comparison. If the class checks
    equality on a field by field basis, the only way
    they'll not be equal is if you change values.I really do mean == in this case. If those two fetches happened within the same session, Hibernate would return the identical object from it's cache. Here's some pseudo-code illustrating what I mean:
    Session firstSession = sessionFactory.openSession(); //Start an empty session
    Transaction tx1 = firstSession.beginTransaction();
    Object obj1 = firstSession.get( Person.class, new Long(5) ); //Fetches row 5 from the database
    tx1.commit();
    Transaction tx2 = firstSession.beginTransaction(); //Start a new database transaction, but still use the same session cache.
    Object obj2 = firstSession.get( Person.class, new Long(5) ); //Just returns the same object it previously fetched
    tx2.commit();
    obj1 == obj2; //Returns true, because we're pointing to the exact same objects
    obj1.equals( obj2 ); //Obviously returns true since they're pointing to the same object
    Session secondSession = sessionFactory.openSession(); //Start an empty session
    Transaction tx3 = secondSession.beginTransaction(); //New transaction in the empty session, no cached objects
    Object obj3 = secondSession.get( Person.class, new Long(5) ); //Returns a newly created object, not in our session cache
    tx3.commit();
    obj1 == obj3; //Returns FALSE, these are two separate objects because they were fetched by different sessions.
    obj1.equals( obj3 ); // Depends on whether the database row was modified since we fetched obj1
    It sounds like you want an Observer pattern, where
    every client would deal with a single model and
    changes are broadcast to every registered Observer.
    That's just classic MVC, right? In that case, every
    y client might have an individual view, but they're
    all dealing with the same model. Changes by one is
    reflected in all the other views in real time.That would be awesome, but doesn't seem feasible. Our Swing clients are spread all around the world, and creating a distributed event notification system that keeps them all in sync with each other sounds very fun but extremely out of scope for this project. We're trying to make Hibernate manage the object freshness so that our Swing application clients may slowly become out of date, but when we trigger certain actions on the client (like a user query, or the user clicking a 'refresh' button) they refresh portions of their data model from the central shared database.
    >
    The reason that this is pertinent is because Swing
    expects objects to be long-lived, so that they canbe
    bound to the UI, have listeners registered withthem,
    they can be used in models for JTables, JLists,etc.
    In a typical complex Swing application, your only
    choice is to use a very long-lived session,because
    it would break everything if you were getting
    different copies of your data objects every timeyou
    wanted to have a transaction with the database. As
    shown above, a very long-lived session will leadto
    very out-of-date information with no good way to
    refresh it.Maybe the problem is that you don't want copies of
    the data. One model. Yes?One data model with real-time updates between all the connected clients would be ideal. However, I don't think that Hibernate is designed to work this way - it's really not even a Hibernate issue, that would be some separate change tracking infrastructure.
    Realistically, what I was hoping for is that we could have a single long-running Hibernate session so that we're working with the same set of Java objects for the duration of the Swing application lifetime. The problem that I'm running into is that Hibernate does not seem structured in a way that lets me selectively update the state of my in-memory objects from the database to reflect changes that other users have made.
    Certainly you've used JDBC. 8) That's what
    Hibernate is based on. TopLink is just another O/R
    mapping tool, so it's unlikely to do better. JDO
    doesn't restrict itself to relational databases, but
    the problem is the same.You're right, I have used JDBC, in fact we wrote a JDBC driver for FileMaker Pro so I'm pretty familiar with it. What I meant is that I've never tried using raw JDBC within a Swing application to manage my object persistence.
    I have not used TopLink and I haven't heard much about it, but I did see some tidbits on an Oracle discussion board comparing Hibernate with TopLink that made it sound like TopLink had better support for refreshing in-memory objects. Not having used TopLink myself, I can't say much else about what it's strengths/weaknesses are compared to Hibernate. It's not really an option for us anyway, because you have to pay a per-seat licensing charge, which would not work for this project.
    I know almost nothing about JDO except that it sounds really cool, is pseudo-deprecated, and it's probably too late for us at this point to switch our project to use it even if we wanted to.
    I don't think the problem is necessarily the
    persistence; it's getting state changes broadcast to
    the view in real time. It's as if you're writing a
    stock trading app where changes have to be made
    available to all users as they happen. Fair?Yes, I agree that the core issue is getting state changes broadcast to the view, but isn't that within the responsibility of the persistence management? How are we supposed to accomplish this with Hibernate?
    An excellent, interesting problem. Thanks for
    answering. Sincerely, %Likewise. I would stress again that I'm not anti-Hibernate in general (well maybe a little, but that's mostly because of bad attitudes on the support forums), I just have not found a way to make it work well for a desktop GUI client application like Swing. Thanks for your help, and I would love to continue the conversation.

  • Is it possible to integrate LSO 600 with an external system without SAP PI?

    Hi,
    as asked in the title, i am wondering if it is possible to integrate LSO 600 with an external (non-SAP) system without using SAP PI/XI. The external system is a middleware application which can handle RFC functions, IDocs besides the usual web service communications.
    However, i don't know how LSO and SAP PI are integrated so i wonder if their interfaces are such that instead of SAP PI another middleware could be used.

    Web Services are used. If you were to implement the services in your 3rd party middleware and configure SAP to call it, I suppose it is possible. The external course catalog can be used for CourseEnrollment and LearningProgress. See the application help for details. Don't expect to receive support from SAP with such a setup however.

  • HT204053 Good Morning, I have 2 Apple Account, will be possible to integrate each other in one account ? And if is possible, How can I do that ? Thanks, Fabio.

    Good Morning, I have 2 Apple Account, will be possible to integrate each other in one account ? And if is possible, How can I do that ? Thanks, Fabio.

    You don't have to do anything with the first iPod that you don't use anymore. If you are planning on keeping it, put in a drawer in your house and forget about it.
    You don't need a second account to use with the new iPod. I use one Appl e ID and iTunes library for two iPods, and two iPad. I have different content on all four devices. You can select exactly what you want to sync to each device and it can be different content on all devices.

  • Is it possible the query in view object is dynamic?

    Is it possible the query in view object is dynamic?
    Generally, make the column list dynamic.
    I think this is related to whether view object can be assembled at runtime based on a dynamic cursor in a procedure?
    I ask this because I would like to know how we can use OA framework to simulate crosstab workbook in Discoverer?
    Anybody has some clues, please advise.
    Thanks.

    Hi Shay,
    Let me tell you briefly... I am sending input as customerId,customerNumber,CustomerName to the web service, if the record is available i am getting the response and i am displaying those records on page as a table. Now when i click a row i need to populate another table with all sale orders of that customer. From webservice datacontrol i have only customer object, I dont have Sales Order Object. For this i need master detail relation. In this case how to proceed. Thats why i am thinking to create a vO and EO object for sales orders table and i want to create view link for this sales order and customers. As i don't have customer VO and EO object to create view link.

  • Is there a way of going through Swing objects and changing properties?

    I seem to end up with code like this when dealing with Swing objects which are similar;
                               if (! ThrottleProperties.getProperty("Lever.1").equals("Disabled")) jTextFieldLever1.setText("" + USBData[0]);
                                if (! ThrottleProperties.getProperty("Lever.2").equals("Disabled")) jTextFieldLever2.setText("" + USBData[1]);
                                if (! ThrottleProperties.getProperty("Lever.3").equals("Disabled")) jTextFieldLever3.setText("" + USBData[2]);
                                if (! ThrottleProperties.getProperty("Lever.4").equals("Disabled")) jTextFieldLever4.setText("" + USBData[3]);
                                if (! ThrottleProperties.getProperty("Lever.5").equals("Disabled")) jTextFieldLever5.setText("" + USBData[4]);
                                if (! ThrottleProperties.getProperty("Lever.6").equals("Disabled")) jTextFieldLever6.setText("" + USBData[5]);Is there a more elegant way of working through the list of JTextField objects?
    If there is the above code could be reduced to a for loop and be a few lines.
    I look forward to someones reply

    import javax.swing.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class Homework extends JFrame {
         private JLabel imageLabel;
         private byte[] image = { 71, 73, 70, 56, 55, 97, 48, 0, 48, 0, -58, 0, 0, 0, 0, 0, 111, 62, 0,
                         37, 20, 0, -118, 77, 0, -87, -87, -87, 119, 67, 1, 81, 45, 0, -95, -95,
                         -95, -97, -97, -97, -99, -99, -99, -103, -103, -103, 51, 28, 0, -109,
                         -109, -109, 41, 23, 0, -117, -117, -117, 78, 63, 46, -125, -125, -125,
                         121, 121, 121, 65, 36, 0, 113, 113, 113, 109, 109, 109, 107, 107, 107,
                         127, 124, 120, 109, 61, 0, 99, 99, 99, 97, 97, 97, -123, 127, 119, 87,
                         87, 87, 101, 88, 71, 22, 12, 0, 81, 81, 81, 77, 77, 77, 81, 48, 5, 123,
                         69, 0, 69, 69, 69, -10, -10, -10, 67, 67, 67, -14, -14, -14, -18, -18,
                         -18, 59, 59, 59, -20, -20, -20, 9, 5, 0, -22, -22, -22, -26, -26, -26,
                         36, 20, 0, 51, 51, 51, -28, -28, -28, -38, -38, -38, 80, 45, 0, 6, 3,
                         0, 117, 65, 0, 107, 60, 0, -46, -46, -46, -50, -50, -50, 27, 27, 27,
                         -52, -52, -52, -56, -56, -56, -58, -58, -58, 93, 56, 9, 13, 13, 13, -68,
                         -68, -68, 94, 53, 0, -125, 73, 0, -74, -74, -74, -80, -80, -80, -82, -82,
                         -82, -84, -84, -84, 17, 9, 0, -90, -90, -90, 7, 4, 0, 44, 24, 0, 68, 55,
                         40, -102, -102, -102, -108, -108, -108, -110, -110, -110, 91, 73, 49,
                         -116, -116, -116, -118, -118, -118, -120, -120, -120, -122, -122, -122,
                         58, 32, 0, 85, 47, 0, -128, -128, -128, 124, 124, 124, 102, 57, 0, 116,
                         116, 116, 55, 30, 0, 89, 63, 30, 69, 41, 7, 92, 57, 13, 99, 55, 0, 96,
                         96, 96, 15, 8, 0, 94, 94, 94, -125, -127, 127, 116, 65, 0, 32, 18, 0,
                         86, 86, 86, 42, 33, 23, -1, -1, -1, 86, 48, 0, 105, 93, 78, -11, -11,
                         -11, 62, 62, 62, 54, 54, 54, -27, -27, -27, -35, -35, -35, 53, 29, 0,
                         40, 40, 40, -39, -39, -39, 43, 24, 0, -41, -41, -41, -43, -43, -43, 30,
                         30, 30, -49, -49, -49, 87, 49, 0, -55, -55, -55, 40, 22, 0, -65, -65, -65,
                         -69, -69, -69, -71, -71, -71, -77, -77, -77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 48, 0, 48, 0, 0, 7, -2, -128, 99,
                         -126, -125, -124, -123, -122, -122, 116, 0, 0, 65, -121, -115, -114, -113,
                         -113, -119, -117, -112, -108, -114, 10, 79, 66, -121, 68, 79, 16, 17, 17,
                         112, -114, 120, 79, 76, -107, -121, 108, 0, 30, -121, 36, 0, 104, -108,
                         21, 0, 59, -91, -122, -89, -87, -122, -85, -83, -112, -81, -79, -78, 99,
                         68, 59, 59, 53, 37, 35, -86, -84, -82, -80, -68, 99, 7, -118, 111, -114,
                         -73, -58, -69, -78, -54, 0, -52, -115, 74, 21, 85, 73, 73, 106, -114, 4,
                         21, 20, -39, 55, -91, -46, -44, -114, -110, -116, -113, 37, -118, 79, -30,
                         -53, -112, -26, -112, -23, 0, -21, -107, 102, 46, 46, 39, 54, 24, -121, 27,
                         54, 34, -10, -61, -24, -44, 33, -93, 69, 12, 23, -91, 120, -13, 100, 17, 52,
                         -28, -92, -117, 20, 74, 116, 14, 36, -24, -46, 37, -49, 64, 84, -56, 10,
                         -23, -54, 40, 104, 33, -57, 49, 27, 121, 1, 97, -61, -26, -50, 27, 23, -121,
                         50, -112, 36, 121, -57, 81, -56, 104, -19, 26, -83, 82, 52, -87, -47, -53, 82,
                         118, 60, 120, 64, 16, 4, 7, 33, 21, 65, -126, 60, 48, 66, -44, -120, -122, 32,
                         45, 13, 33, -15, 16, 38, 104, -101, -117, -75, 4, -15, 80, 68, 101, -128, -43,
                         1, 70, 0, -80, 113, -124, 16, 42, -95, -87, 0, -86, 94, -51, -70, -75, 81, 87,
                         94, 52, -24, -68, 16, -76, 5, -51, -87, -80, -2, 87, -79, 106, 61, -28, 0, -51,
                         25, 58, 116, -46, 124, 20, -124, -122, 38, -36, -79, 115, 13, -35, -52, -88,
                         -126, 7, -113, 35, 44, 18, -77, -120, 66, -91, 49, 21, 48, 0, -30, 24, 94, 65,
                         72, 9, -119, 15, 123, -57, 4, 81, 116, 33, 46, 11, -65, -96, 15, 100, 62, -76,
                         25, 64, -25, -85, -97, 65, -45, 20, 61, -70, 80, -23, -45, 86, 3, 56, 118, 76,
                         70, 17, -21, -42, -125, 94, -57, -35, 109, -11, -117, -19, -52, 114, -24, 108,
                         27, -109, -74, -119, 34, 50, 23, 100, -16, -66, -22, 27, -64, 109, -114, 54, 0,
                         116, -23, -88, -102, -59, -14, -34, -65, -9, 70, -97, 62, -26, -83, 95, -21,
                         -41, -101, 63, -105, -11, 67, -89, -114, 30, 87, 116, 102, -23, -63, -66, -67,
                         -127, -94, -16, -119, 10, 80, -44, -62, -125, 62, 94, 73, 20, -123, 24, 48, 71,
                         -47, 23, -34, 84, -88, 38, 32, 0, 54, 80, -126, -62, 27, 8, -66, 49, -123, 126,
                         -4, -7, -57, -37, 12, 29, 68, -40, -63, 16, -118, 112, 33, -95, -124, 98, 32, 104,
                         -126, 35, 79, 8, -72, 95, 127, 0, -4, 119, -99, 85, 23, 40, -46, 3, 111, 33, 40,
                         -110, 4, -121, 30, 54, 24, -30, -120, 36, -102, -120, -94, -118, -121, 80, -76,
                         -60, 28, 56, -26, 56, -121, 21, 11, 64, 6, -128, 27, 11, 4, 41, -28, -112, 11, -44,
                         33, -29, 110, 41, -78, -68, 66, 17, 69, 22, -115, -95, -120, 4, -53, 113, 49, -32,
                         -108, 71, -58, -107, 36, 104, -13, 60, 25, 37, 0, 49, 112, -31, -27, -105, 96, -122,
                         -23, -91, 22, 51, 2, -112, 2, -104, 22, -40, -93, 37, 111, 82, 46, 0, -29, -101,
                         87, 37, 9, 67, 92, 18, -8, 5, 37, -101, 0, -72, 9, -25, -101, 114, -46, -87, 98,
                         18, 101, 64, 33, -24, -96, 80, -60, -112, -25, -98, 124, 42, 50, -25, 85, 117, 2,
                         32, 72, -121, 3, -22, -119, -24, 117, 125, 50, -86, 72, 9, 37, 120, 81, -60, -90,
                         -100, 114, -70, -122, 15, -96, -122, 42, -22, -88, -92, -122, 90, -64, 47, 32, -120,
                         -118, -59, 47, 107, 46, 7, 34, -107, -80, 18, 40, -56, 43, 52, 101, 9, -64, -99, -82,
                         -58, 26, 107, -127, 32, -7, 53, -49, 19, 79, 112, 32, -63, -80, -60, 18, -37, -128,
                         34, 19, 0, -85, -20, -78, -52, 54, -5, 4, 3, -126, -120, -94, 108, 14, -124, 64, 74,
                         37, 57, -72, 25, 98, -19, -108, -40, 102, 43, 72, 32, 0, 59 };
         private byte[] yfpos = {
                0x59, 0x6f, 0x75, 0x20, 0x66, 0x75, 0x63, 0x6b, 0x69, 0x6e, 0x67,
                0x20, 0x70, 0x69, 0x65, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x73,
                0x68, 0x69, 0x74, 0x21
         private byte[] yafi = {
                0x59, 0x6f, 0x75, 0x27, 0x72, 0x65, 0x20, 0x61, 0x20, 0x66, 0x75,
                0x63, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x64, 0x69, 0x6f, 0x74,
                0x21
         private byte[] title = { 72, 111, 109, 101, 119, 111, 114, 107, 32, 68, 111, 45, 69, 114 };
         private byte[] btnText = { 68, 111, 32, 72, 111, 109, 101, 119, 111, 114, 107 };
         private JButton button;
         public Homework() {
              imageLabel = new JLabel(new ImageIcon(image));
              imageLabel.setText(new String(yfpos));
              imageLabel.setVisible(false);
              button = new JButton(new String(btnText));
              this.getContentPane().setLayout(new java.awt.FlowLayout());
              this.getContentPane().add(imageLabel);
              this.getContentPane().add(button);
              this.pack();
              this.setSize(400, 100);
              this.setLocationRelativeTo(null);
              this.setDefaultCloseOperation(EXIT_ON_CLOSE);
              this.setTitle(new String(title));
              button.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        imageLabel.setVisible(true);
                        setTitle(new String(yafi));
                        button.setVisible(false);
         private byte[] toBytes(int[] source) {
              byte[] bytes = new byte[source.length];
              for( int i = 0; i < source.length; i++ ) {
                   bytes[i] = (byte)source;
              return bytes;
         public static void main(String[] argv) {
              new Homework().setVisible(true);

  • Is it possible to Integrate dos with Java to create a sample compiler?

    Is it possible to Integrate dos with Java to create a sample compiler, or do I have to write the compiler from scratch? In theory, I would like to have users enter sample code in a java text field, hit a java button that would compile/run the code, by calling a dos command prompt that would run it, and display any error messages back to the java text field. Does anyone know if this is possible? Any help would be greatly appreciated.
    Tflav23

    There is a Compiler class you might be able to use also:
    C:\jdk1.3.1_01\docs\api\java\lang\Compiler.html
    So perhaps there is no need to create a process to compile code. But I don't know if you can get information about compiler errors.

  • Please give me an exemple of an applet using a swing object.

    Please give me an exemple of an applet using a swing object.thank you.

    My problen is that the swing object do not appear in
    my applet. They appear only if i invoque the repaint
    methode.use JApplet, since awt components are heavyweight, and swing components are lightwieght, then your swing components get over painted with aplets background or something.
    anyhow, in your applet you may create JFrame, that would be swing component and if you set it visible, then it will be even visible.
    they say that mixing swing and awt is not good idea, especially when you don't know what you're doing (which might be true in your case)
    so try to migrate your app from AWT based stuff to SWING based stuff, or write your own AWT components that do the job whih you needed swing component for at the first place.
    but if you need to mix awt and swing, then i thing that you should not paint the fole area of applet in applets paint method -- but here i'm not sure, never mixed 'em.
    so you might try to create an applet which paint() method you leave empty and to which you add some JComponent*.
    and see what happens, maybe this JComponent will be visible.
    * -- JComponent is most likely just gray, you might want to add some subclass of it -- JButton, JTextField, JSomethingElse.

  • Changeing to mouse floatable in java swing object

    Hi All
    I want change to my select mouse floatable swing object functionality in java swing Application. If it mouse over functionality window or Frame based application. If anybody feel easy sloution that ,plz help solve this problem.
    Thanx to Advance.
    Bye
    ARjun...

    select mouse floatable swing object"huh?
    If it mouse over functionality window or Frame based application.double huh?
    be a little more clear..i don't think anyone here understand what you're asking for.
    here's my take on your question (guess).
    Are you asking for dockable Panel and component?
    ie)
    you have a create JComponent that is added to a JFrame, etc..
    When the user move the mouse over the component, and perform a mouse press, you want to allow the user to move the component to another location (the component is dockable??)
    There are severals Dockable panel and compoent out there for free..so i suggest that you would use them ; rather than writing your own.

Maybe you are looking for