Page 1 of 2 12 LastLast
Results 1 to 20 of 22
  1. #1
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation What classes and methods to use?

    Hi,

    I am developing a system wherein, a server holds all connected clients through class Socket. But I am trying to intregrate GUI on it.

    My problem is how I could create a dragable environment of objects (JPanel, JButton, etc.) so that I wouldn't able to utilize the FlowLayout class which displays the client in an orderly manner. What class and methods I am to use?
    What implementation I am going to use to save the configuration? What file format I am going to use?

    To visualize further this problem, the system I am trying to develop is a classroom management system wherein the room adminstrator will configure the environment to a seat plan like diagram.

    Thanks.
    Last edited by chyrl; 06-16-2010 at 01:11 AM.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    how I could create a dragable environment of objects
    Are you asking how to move components that are layed out in a Container using the mouse?
    Sounds like a GUI builder in an IDE.

    An approach is to write your own layout manager that will take mouse movements and translate them into new locations for the moved Components. Sound like an interesting project.

    How does this changeable GUI relate to the client/server part?

  3. #3
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    Quote Originally Posted by chyrl View Post
    Hi,

    how I could create a dragable environment of objects (JPanel, JButton, etc.) so that I wouldn't able to utilize the FlowLayout class which displays the client in an orderly manner. What class and methods I am to use?
    Emm...

    I think you can use JLayeredPane because its components can use an absolute location using methods as
    Java Code:
    setLocation() 
    and 
    setBounds()
    So you can easly program the components be dragged with your mouse. But of course it is not a simpliest way but I think it should solve your problem.
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  4. #4
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    Quote Originally Posted by Norm View Post
    Are you asking how to move components that are layed out in a Container using the mouse?
    Sounds like a GUI builder in an IDE.

    An approach is to write your own layout manager that will take mouse movements and translate them into new locations for the moved Components. Sound like an interesting project.

    How does this changeable GUI relate to the client/server part?
    Yes, exactly. The project is like similar to GUI builder of an IDE.

    This changeable GUI does relate to the C/S because the interaction will be mostly easier to comprehend especially for the lower class man who might be using this project.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  5. #5
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    Quote Originally Posted by Webuser View Post
    Emm...

    I think you can use JLayeredPane because its components can use an absolute location using methods as
    Java Code:
    setLocation() 
    and 
    setBounds()
    So you can easly program the components be dragged with your mouse. But of course it is not a simpliest way but I think it should solve your problem.
    Ok. JLayeredPane could be an option to solve this thread.
    But the next question, how would I save the configuration of the JLP?
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    changeable GUI does relate to the C/S because the interaction will be mostly easier to comprehend
    Doesn't make any sense to me. I see the two as unrelated.

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Norm View Post
    changeable GUI does relate to the C/S because the interaction will be mostly easier to comprehend
    Doesn't make any sense to me. I see the two as unrelated.
    That sentence could've been written in a managerial report because it doesn't make any sense at all; it's humbug.

    kind regards,

    Jos

  8. #8
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation

    Quote Originally Posted by Norm View Post
    Doesn't make any sense to me. I see the two as unrelated.
    The project is like a computer kiosk management system.
    What I wanted is in the server, the clients are arranged by the admin thru JLP so that the employees could open and close the client easier and faster than using the FlowLayout. The project is like the CyberCafe Pro system in which the clients are arranged by the admin.

    Quote Originally Posted by JosAH View Post
    That sentence could've been written in a managerial report because it doesn't make any sense at all; it's humbug.

    kind regards,

    Jos
    What do you mean?
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    in the server, the clients
    I assume "server" and "clients" here are actually some component showing in a frame.
    I use those terms to mean PCs running software for their function.
    faster than using the FlowLayout.
    Not sure what this means. FlowLayout is a layout manager that lays out components in a container.
    the clients are arranged by the admin
    Again it sounds like "clients" is a component being shown in a window. Like a JPanel with an image or a JButton.

    What is "JLP"? Google doesn't return anything related to Java.

  10. #10
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    Quote Originally Posted by Norm View Post
    I assume "server" and "clients" here are actually some component showing in a frame.
    I use those terms to mean PCs running software for their function.

    Not sure what this means. FlowLayout is a layout manager that lays out components in a container.

    Again it sounds like "clients" is a component being shown in a window. Like a JPanel with an image or a JButton.

    What is "JLP"? Google doesn't return anything related to Java.
    In terms of JLP, I apologize for my abbreviation, it means JLayeredPane.

    The performance between FlowLayout and JLP doesn't matter most in the project. What matters more is what happens in the real world. Like the exchange of money, or id, etc., the searching time lessens and the human-error percentage also lessens.

    The clients are infact in a JPanel and inside of it are essential elements of each client.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by chyrl View Post
    What do you mean?
    Yes, that could've been my alternative reply.

    kind regards,

    Jos

  12. #12
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    Quote Originally Posted by JosAH View Post
    Yes, that could've been my alternative reply.

    kind regards,

    Jos
    Ok. See reply 8 and 10.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  13. #13
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    Ok the talk about server and client wasn't about servers and clients on the internet.
    Those are your names for components being displayed on a screen.
    matters more is what happens in the real world
    Yes of course that is always true.
    But this a java programming forum and we answer questions about that.

    Are there any programmers you can talk to and have post the questions here?
    As mentioned earlier, your posts sound like they are
    written in a managerial report

  14. #14
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation

    Quote Originally Posted by Norm View Post
    Ok the talk about server and client wasn't about servers and clients on the internet.
    Those are your names for components being displayed on a screen.

    Yes of course that is always true.
    But this a java programming forum and we answer questions about that.

    Are there any programmers you can talk to and have post the questions here?
    As mentioned earlier, your posts sound like they are
    This isn't a mangerial report. This is a system report.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  15. #15
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by chyrl View Post
    This isn't a mangerial report. This is a system report.
    It is more like a combination of a buzz phrase competition and BS bingo.

    kind regards,

    Jos

  16. #16
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation

    Quote Originally Posted by JosAH View Post
    It is more like a combination of a buzz phrase competition and BS bingo.

    kind regards,

    Jos
    A system report for a case study for my project.
    Anyways. I'm still a student.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  17. #17
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,526
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by chyrl View Post
    A system report for a case study for my project.
    Anyways. I'm still a student.
    First, try to get your jargon right because as it is now you are making up terms so that you are not able to communicate with the rest of the world; e.g. visual components are not clients.

    kind regards,

    Jos

  18. #18
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    Quote Originally Posted by chyrl View Post
    Ok. JLayeredPane could be an option to solve this thread.
    But the next question, how would I save the configuration of the JLP?
    Unusual but anyway...
    You can use an ArrayList or something to keep the JLayeredPane components location and options and then simply save it as a *.anyext file :)
    Last edited by Webuser; 06-17-2010 at 02:44 AM.
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  19. #19
    gafa's Avatar
    gafa is offline Senior Member
    Join Date
    Jun 2010
    Posts
    107
    Rep Power
    0

    Thumbs up

    Quote Originally Posted by Webuser View Post
    Emm...

    I think you can use JLayeredPane because its components can use an absolute location using methods as
    Java Code:
    setLocation() 
    and 
    setBounds()
    So you can easly program the components be dragged with your mouse. But of course it is not a simpliest way but I think it should solve your problem.
    Webuser is right. That may become the best way to solve the idea :)
    I can add that you have to work with MouseListener a lot to make it work but it worth the effort
    + 1 my REP
    Good Luck :)

  20. #20
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    By setting the layout manager to null you can use setBounds() in any container.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 8
    Last Post: 04-16-2012, 11:00 PM
  2. using methods between classes
    By soccer_kid_6 in forum New To Java
    Replies: 2
    Last Post: 04-18-2010, 03:14 AM
  3. methods, classes, arrays.. oh my!
    By katalyst in forum New To Java
    Replies: 30
    Last Post: 03-30-2009, 12:57 AM
  4. Classes and Methods help
    By border9 in forum New To Java
    Replies: 5
    Last Post: 01-30-2009, 06:51 PM
  5. How to call methods of different classes
    By adeeb in forum New To Java
    Replies: 2
    Last Post: 06-06-2008, 06:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •