Using of JLoox components in Swing/AWT Paint

I am facing problem in using JLoox components in Swing/AWT Paint method.I am able to use the JLoox components in Constructor of Swing JFrame and facing problem while using the JLoox components in Paint method.If anybody used JLoox please suggest the way to use it.

Yes I have used JLOOX since last 2 years.
There is a LxGraph derived from LxAbstract and LxView derived from LxAbstractView. This LxAbstractView is in turn derived from JComponent. LxGraph is a model for LxView (same apporch like MVC). You create components (i.e. LxRectangle, LxCircle, LxLine, LxLink, etc) and add it to either graph or in view). Finally this view (i.e. LxView) is added to a java container (JPanel, JScrollBar, etc.) You cannot pass JLoox component into JFrame constructor.
-regards,
Pratap

Similar Messages

  • Changing AWT components to Swing components

    I'm having a little trouble changing some AWT components to Swing components. I received an error message when I tried to run my program. I looked up the component in the java docs. But, I did not see the option the error was talking about. The error and the area of code is listed below. Thank you for any help you can provide.
    Error message:
    Exception in thread "main" java.lang.Error: Do not use P5AWT.setLayout() use P5A
    WT.getContentPane().setLayout() instead
    at javax.swing.JFrame.createRootPaneException(JFrame.java:446)
    at javax.swing.JFrame.setLayout(JFrame.java:512)
    at P5AWT.<init>(P5AWT.java:56)
    at P5AWT.main(P5AWT.java:133)
    Press any key to continue . . .
    Code:
    JPanel p3 = new JPanel();
    p3.setLayout(new FlowLayout(FlowLayout.CENTER));
    ta = new JTextArea(20, 60);
    p3.add(ta);
    setLayout(new FlowLayout(FlowLayout.CENTER));
    add(p3);

    you need to change the line...
    setLayout(new FlowLayout(FlowLayout.CENTER)); to
    getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER));

  • Help required building ADF-Swing/ADF-Faces using ADF Business Components

    My question is in regards to how you can go about building a light swing application to an ADF model?
    In particular if I were to say that we were developing a 3-tier project whereby we had a database tier, a series of EJB-ADF façade session beans to the database (middle-tier), and a swing client communicating with the session beans (view-controller tier), how would you go about developing these screens?
    In particular can we develop these screens using ADF-Faces and also ADF-Swing?
    The EJB session façade beans of course are ADF app modules with customised methods. The methods would return back customised DTO objects. These DTO objects are wrappers to row objects ADF would create. This would be mainly due to making these facade beans web service enabled (Oracle state that these methods cannot return oracle.jbo objects if they are to be web service enabled).
    This would be typically deployed to an app server, like Oracle App Server 10G.
    Could you please have a look at this, as I am doing a lot of research into this.
    eg. Taking example from oracle magazine sept/oct 2006
    with slight enhancements
    package oramag.frameworks.example.common;
    import oracle.jbo.ApplicationModule;
    import oramag.frameworks.customdto.EmployeeDTO;
    public interface HRService extends ApplicationModule {
    void deleteCurrentEmpAndCommit();
    EmployeeDTO findEmployee(int employeeId); // new method
    import oramag.frameworks.customdto.EmployeeDTO;
    public class HRServiceImpl extends ApplicationModuleImpl {
    public void deleteCurrentEmpAndCommit() {
    Row empRow = getEmpView().getCurrentRow();
    if (empRow != null) {
    empRow.remove();
    getDBTransaction().commit();
    public EmployeeDTO findEmployee(int employeeId)() {
    EmployeeDTO employeeDTO = null;
    EmployeesImpl employees = getEmployees();
    employees.setNamedWhereClauseParam("EmployeeId", employeeId);
    employees.executeQuery();
    if(employees.hasNext()) {
    EmployeesRowImpl employee = (EmployeesRowImpl)employees.next();
    employeeDTO = new EmployeeDTO(employee);
    return employeeDTO;
    public EmployeesImpl getEmployees() {
    return (EmployeesImpl)findViewObject("Employees");
    Now given the above code snippet, how could you turn this into an ADF-Swing/ADF Faces application so that if a user using the swing application enters an employee id, then the application will execute the query on the app server, the app server in turn returns the results to the client, and the client finally display the results. Typical MVC example.
    Cheers
    Rodney

    The tutorial is for ADF BC used with JavaServer Faces.
    While the tutorial doesn't cover it, we also support drag and drop development for Swing and visual WYSIWYG layout for Swing panels and windows, too. For a very simple example, watch screencast #4 on my blog here:
    http://radio.weblogs.com/0118231/stories/2005/06/24/jdeveloperAdfScreencasts.html
    One thing I have noticed is that when using ADF business components, when the app module returns a custom DTO object like the above example, it returns the data in a element structure according to the data control palette.
    You don't generally ever need to create your own custom DTO's when working with ADF for use by client UI's. The only situation where can be necessary -- until we simplify this in the JDeveloper/ADF 11g release -- is when you desire to expose custom methods that can return sets/arrays of typed row structures through a web service. However, web services are not involved/required in building 3-tier Swing applications.
    When dropping onto a page it does so like a string and doesnt give option to display the data in a read only form etc. Is there anything we need to do, to get the functionality.
    It's more of what you don't need to do :-)
    Just leverage the active data model that the ADF application module provides. You can read more about it in section 4.5 "Understanding the Active Data Model" of the ADF Developer's Guide for Forms/4GL Developers on the ADF Learning Center at http://www.oracle.com/technology/products/adf/learnadf.html). Your UI's bind to view object instances in the data model, and your UI's are automatically kept up to date without needing to write methods that return data. I short article I wrote that preceeded my writing the ADF Developer Guide content on this topis is here:
    http://radio.weblogs.com/0118231/stories/2006/01/26/theAdfBusinessComponentsActiveDataModel.html
    I know that when dropping a view object you get this functionality. Also was wondering if we were to pass an object of thios type back to the model it might not give us the rich functionality like input forms, like what Oracle provides if we were to drop a enitity view object.
    Just use the active data model and everything becomes totally easy, with no changes required to switch between local or three-tier deployment configurations.
    Trying to do everything with hand-coded DTO beans is really going the hard way.
    Could you help us regarding this?

  • Best way for gui programming? swing awt jfc swt ....

    hi,
    i have been programming java for some time but exclusively for web, servlets, jsp etc..
    but now i have to do some �real� gui�s. I have no gui experience , (ok I did some basic examples just to see how things work) but/and I�m not able to determine which way I should go.
    So I did some google search and read some threads here im forum on topics swing vs. awt (or so) and found lot of topics with lot of different opinions(some of them also a little bit out of date) so now im CONFUSED more then ever.
    I read people asking questions like :what is better awt or swing and then getting the perfect technical answers like :
    AWT components are NOT native components. AWT components are Java objects. Particular instances of AWT componets (Button, Label, etc.) MAY use peers to handle the rendering and event handling. Those peers do NOT have to be native components. And AWT components are NOT required to use peers for themselves at all.
    Or
    There are some significant differences between lightweight and heavyweight components. And, since all AWT components are heavyweight and all Swing components are lightweight (except for the top-level ones: JWindow, JFrame, JDialog, and JApplet), these differences become painfully apparent when you start mixing Swing components with AWT components.
    But I don�t care that much(at least not now) about this detail answers.
    I would simply like to know from some experienced gui guru, (due to the fact that we have 2005 and java 1.5) if u would like to learn gui in java quickly and know everything u know now which way would u choose:
    AWT
    JFC
    SWING
    SWT
    And which IDE would u use.
    I simply want to get quickly started and do some basic gui programming ,nothing special, but I would like to avoid that after weeks of doing one, then find out the was the wrong one and again learn the another one.
    TIA Nermin

    try swt vs swing and see what you think, its not really a decision someone else can make for you. as long as you don't try and mix the two, it should be a similar learning curve either way.

  • Painters (java.awt.Paint interface)

    Hello,
    I would like to implement a collection of painters (like GradientPaint, TexturePaint ..). Unfortunatelly, I found little information regarding this topic on the web. I found out that I need to implement the java.awt.Paint interface (and everything that it implies: PaintContext etc..). Do you know of any web site that might have some form of collection of this painters, or more complex information like algorithms for simple textures...Mabe I am asking the question wrong, that's why any links to basic resources that I can start with are welcome. I have allready taken a look at :
    http://swing-fx.blogspot.com/2008/05/glossy-and-shiny-shapes-with-paint-and.html
    http://drj11.wordpress.com/2007/04/02/subclassing-javaawtpaint/
    These helped me to understand the logic..but I feel left somwhere in the air with only this information.
    Any help is appreciated!
    Regards,
    Radu Cosmin

    Hello,
    I would like to implement a collection of painters (like GradientPaint, TexturePaint ..). Unfortunatelly, I found little information regarding this topic on the web. I found out that I need to implement the java.awt.Paint interface (and everything that it implies: PaintContext etc..). Do you know of any web site that might have some form of collection of this painters, or more complex information like algorithms for simple textures...Mabe I am asking the question wrong, that's why any links to basic resources that I can start with are welcome. I have allready taken a look at :
    http://swing-fx.blogspot.com/2008/05/glossy-and-shiny-shapes-with-paint-and.html
    http://drj11.wordpress.com/2007/04/02/subclassing-javaawtpaint/
    These helped me to understand the logic..but I feel left somwhere in the air with only this information.
    Any help is appreciated!
    Regards,
    Radu Cosmin

  • An issue using the COM components supplied with SAP GUI 6.2 or 6.4

    We are having an issue using the COM components supplied with SAP GUI 6.2 or 6.4.  We used to have SAP 4.6c and now we have 5.0.  When we were on 4.6c, we used these COM components to logon and execute RFC calls and we had much success.  Now that we are on 5.0, we can’t seem to instance any SAP functions that have something to do with SAP Workflow.  We have experienced this problem when using VB6 or .NET, but our existing code that always worked is in VB 6.0.
    SAP Components used:
    o     SAP Logon Control
    o     SAP Function Control
    o     Librfc32.dll
    o     Other supporting C DLLs and/or COM object supplied with the SAP GUI installation.
    For example, if we want to call the RFC ARCHIV_CONNECTION_INSERT, this code fails in VB6 when the “Set objworkflow = objFuncCtrl.Add(strFunction)” line of code executes.  Instead of returning an instance of the object ARCHIV_CONNECTION_INSERT function, no object is created.  In 6.2, SAP raises no errors, but the object we are trying to create is still “Nothing”.  If we use 6.4, SAP raises an error “SAP data type not supported” via a message box and then the object is still = Nothing.  Interestingly enough, the 6.2 GUI COM controls don’t display the error dialog.  The message box that is shown comes from the SAP Function COM Object "SAP.Functions" (wdtfuncs.ocx).
    Now, what is interesting is if we use the same code to call a standard function or custom function that doesn’t have anything to do with SAP Workflow, then the code works fine.  Again, all of our code used to work just fine on an SAP 4.6 system.
    Here is the code that fails:
        'SAP Logon control - object for creating connections to an SAP system
        Dim objSAPLogonCtrl As Object
        'SAP connection object
        Dim objConnection As Object
        'Object that will represent the SAP function called
        Dim objSAP As Object
        'SAP function control object - object factory for creating other SAP function objects
        Dim objFuncCtrl As Object
        'Create instance of an SAP logon conrol
        Set objSAPLogonCtrl = CreateObject("SAP.Logoncontrol.1")
        'Create a connection object
        Set objConnection = objSAPLogonCtrl.NewConnection
        'Define connecion parameters
        objConnection.ApplicationServer = "sapvm"
        objConnection.SystemNumber = "00"
        objConnection.Client = "800"
        objConnection.User = "iissap"
        objConnection.Password = "tstadm"
        objConnection.Language = "E"
        objConnection.TraceLevel = 10
        'call the logon method of the connection object
        If objConnection.Logon(0, True) = False Then
            MsgBox Error
            Exit Sub
        End If
        'Create an instance of the SAP Function control object
        Set objFuncCtrl = CreateObject("SAP.Functions")
        'Set the function control connection object
        Set objFuncCtrl.Connection = objConnection
        'Function name to be generated and called
        Dim strFunction As String
        strFunction = <b>"ARCHIV_PROCESS_RFCINPUT"</b>
        'Create an instance of the function defined in strFunction
        Set objworkflow = objFuncCtrl.Add(strFunction)
        If objworkflow Is Nothing Then
            MsgBox "Could not create object " & strFunction
        Else
            MsgBox strFunction & " object created."
        End If
    If anyone has seen anything like this or has any ideas, please help!
    Mike and Hameed
    <b></b>

    Hi,
    documentation on the Scripting API is available at ftp://ftp.sap.com/pub/sapgui/win/640/scripting/docs/
    This API is a replacement of the existing, obsolete COM interfaces.
    Best regards,
    Christian

  • How to use Active x components in JAVA

    Hi,
    I want to know whether can we use active x components in java.If yes then what is the right method to do so.
    regards
    Anshuman

    I have once heard of a tool in Visual J++ which create a wrapper class (A Java File) when you provide the ActiveX component.
    But I think it is heavily dependant on Ms Java VM

  • How to use annotation with GUI in swing

    hi,
    i am new to annotation. I know how to use this with classes, methods and java elements. I am developing a tool in applet to post comment on my notepad, but unable to find that how to use this with GUI of swing. I have gone through most of forums and tutorials but got no idea. Anyone could give me little idea.
    Thanks

    >
    i need to use the applet mousedown function in swing..>There is no such class as 'applet' in the JRE, Swing has an upper case 1st letter, functions in Java are generally referred to as methods, and there is no 'mousedown' method in the JRE.
    OTOH a Swing JApplet inherits the mouseDown method from Component, and it was deprecated in Java 1.1. The documentation (JavaDocs) provides instructions on what to use instead.
    >
    is there any way to use it or any other alternative is available for this?
    if can provide me a sample code.>If can provide me cash. Short of that, you might actually need to do some research/coding of your own.
    As an aside. What does any of this have to do with Java 2D?

  • Cannot make entry in used web dynpro components

    Hi,
    I have added public part in Used DCs
    But when i try to add the used Web Dynpro Component , i dont see the DC i have added when i click browse button
    what dependencies should be given while adding the public part in Used DCs ? i have given only default ie build time
    thanks.

    Hi,
    Follow this way, hope it will helps you
    1:Add Component of childDC to PublicPart and build it (RightClick on DC>DevelopmentComponent>Biuld)
    2: Expand parentDC>DC MetaData>DC Definition>RightClick on UsedDcs>Add used DC>Select childDC>Finish.
    Build parentDC as above (not Rebuild)
    3:Now expand ParentComponent>RightClick on Used Web Dynpro Components>Add UsedComponent> give name and choose browse >select childDC component> Ok>Finish
    Regards
    LN

  • Does the nb7.1 support using the javafx Components panel to design the ui?

    does anyone knows whether the nb7.1 support using the javafx Components panel to design the ui? thanks

    Hello guys, what kind of support would you like to see?
    Code snippets in the palette?
    Please answer here: What would you like to have in NetBeans 7.2 for JavaFX?

  • Does any one used 3rd party components like ICEFaces ?

    Hi
    Thank you for reading my post.
    does any one used 3rd party components like ICEFaces components with Creator Studio?
    What are other components pack that we can use in Creator?
    thanks

    OK, thanks to Peter Hanusiak, and Oracle Consulting consultant in Slovakia, I have resolved my issue and I'm hoping that the same solution may apply for you. See below for the instructions from Peter that helped me out. Note that since our applications are different, the specific libraries and locations that you need to confirm compatibility for may be different.
    Hope this helps,
    Dave
    I had similar problem. And in my case it was caused by different ADF from JDev and SOA Suite and SOA order booking demo.
    Because I can't test it now, I'll tell just what I remember.
    In SOADEMO is somewhere folder SOADEMO-CLIENT\UserInterface\public_html\WEB-INF\lib
    where you can find
    adf-faces-impl.jar
    jsf-impl.jar
    Try to find exactly the same libs in Jdev and copy&paste from Jdev to SOADEMO folder. then find the libs in SOASuite, and copy&paste from Jdev to SOA Suite those libs. Restart SOA Suite. Deploy Soademo-Client. And hopefully it will work.

  • File transfer using tcp that  implements in swing

    Can anybody send me the file transfer using tcp that implements in swing codes

    I'm assuming that you're inputing a plain ASCII text SQL file. It's easier to use Readers if you're dealing with plain text, the Output and Input Streams are for Byte input and output. So:
    BufferedReader myReader = new BufferedReader(new FileReader("myFile.sql"));
    BufferedWriter myWriter = new BufferedWriter(new InputStreamWriter(mySocket.getInputStream()));
    String inString;
    while((inString = myReader.readLine()) != null)
    myServerWriter.write(inString);
    myServerWriter.writeLine();
    myServerWriter.flush();
    Then, in the server you can use the same method that I'm using for the Buffered Reader to read in the file, and use a BufferedWriter wraped around a FileWriter to output the text to that file. Bravo.
    -Jason Thomas.

  • AWT components in swing not working

    Hi,
    We are developing a swing based GUI application.
    Here we add a third party AWT based component into the JPanel. But if we add that AWT component, it does not show our JMenuItems properly.
    Can somebody tell me what is the problem with the code below? Why it is not displaying my JMenuItems ?????
    import java.awt.*;
    import javax.swing.*;
    public class ButtonTest extends JFrame
         JMenuBar mbar;
         JMenu file;
         JMenuItem i1, i2, i3;
         Container con;
         public ButtonTest()
              con = this.getContentPane();
              con.setLayout(new BorderLayout());
              mbar =      new JMenuBar();
              file = new JMenu("FILE");
              i1 = new JMenuItem("Item1");
              i2 = new JMenuItem("Item2");
              i3 = new JMenuItem("Item3");
              this.setJMenuBar(mbar);
              file.add(i1);file.add(i2);file.add(i3);
              mbar.add(file);
              con.add(new Button("OK"));
         public static void main(String args[])
              JFrame mf = new ButtonTest();
              mf.setSize(400 ,400);
              mf.setVisible(true);
    regards,
    Anand

    Replace them with this.
    import java.awt.*;
    import javax.swing.*;
    public class ButtonTest extends JFrame
         JMenuBar mbar;
         JMenu file;
         JMenuItem i1, i2, i3;
         Container con;
         public ButtonTest()
              con = this.getContentPane();
              setSize(600,600);
              mbar = new JMenuBar();
              setLayout(new FlowLayout());
              file = new JMenu("FILE");
              i1 = new JMenuItem("Item1");
              i2 = new JMenuItem("Item2");
              i3 = new JMenuItem("Item3");
              file.add(i1);file.add(i2);file.add(i3);
              mbar.add(file);          
              con.add(new JButton("OK"));
              setJMenuBar(mbar);
              setVisible(true);
         public static void main(String args[])
              ButtonTest mf = new ButtonTest();
    }

  • Here is the code, only swing components behave badly, awt components seemok

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.lang.*;
    public class gui extends JPanel{
    String[] infochoice = {"Postcode","Locality","State","BSP"};
    JComboBox infowanted;
    JLabel lab;
    Choice cho;
    public static JButton quit;
    public gui(){
    infowanted = new JComboBox(infochoice);
    infowanted.setEditable(false);
    infowanted.setSelectedIndex(0);
    infowanted.setEnabled(true);
    lab = new JLabel("Select one");
    lab.setText("<html><font color=blue> Please select one</font></html>");
    cho = new Choice();
    cho.add("Postcode");
    cho.add("Locality");
    cho.add("State");
    cho.add("BSP");
    quit = new JButton("QUIT");
         ActionListener actlist = new ActionListener(){
    public void actionPerformed(ActionEvent e){
    if(e.getSource() == quit) {
         System.exit(0);
    add(lab);
    //add(infowanted);
    add(cho);
    add(quit);
    public static void main (String args[]) {
    String feel = UIManager.getSystemLookAndFeelClassName();
    try{
    UIManager.setLookAndFeel(feel);
    catch (Exception e){
    System.err.println(e);
    JFrame frame = new JFrame("Kyri");
    JPanel panel = new gui();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
    frame.setSize(300,100);

    So for me... and by the way, what is your problem ?
    NOTE: Did you read about NOT mixing AWT and SWING ?...

  • How to change the Color of a string using swings/awt concept.

    Hi friends,
    How can i change the Color of a string.
    For ex:
    If i have a string "Welcome to the Java World",I want one particular Color for the string "Welcome to the" and a different Color to the "Java World" string.
    So please kindly help me out to resolve this issue.
    Thanking u in advance.

    "Text Component Features"
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html

Maybe you are looking for