Results 1 to 18 of 18
  1. #1
    fresh83 is offline Member
    Join Date
    Dec 2009
    Posts
    55
    Rep Power
    0

    Default Creating Something physical

    Learning references:
    java.sun.com/docs/books/tutorial/java/javaOO/objects (dot)html
    cs.princeton(dot)edu/introcs/15inout/


    How do i create something physical?

    a program that will take user input?

    A program that will import a graphic?

    Where do graphics pop up if i do code them ?

    if you import a class do you have to understand how it works or just know how to use it in your own classes?

    How do i code a program that can be double clicked and open on the desktop. even if it just says hello world.


    Im self teaching myself java to help develop a big project i started along with 2 other developers. Ive made alot of progress but, i can only take in so much info at a time without putting it to use and staying interested, if i could create simple interactive programs i think i could entertain myself while asking the right questions as i go.

    if anyone has any links to examples or can shead some light on the above it be appreciated. Theres only so much you can take of a tutorial ,if theres any human tips for understanding this stuff or someone would be willing to have a aim chat leave ur sn .

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    The links you have above, especially the Sun tutorials will be able to answer all these questions and more. For GUI programming most (I believe) use Swing, for which the Sun tutorials are your best resource. For images, again Swing, and for double clicking, read on creating Jar files.

    Theres only so much you can take of a tutorial ,if theres any human tips for understanding this stuff
    Your questions are good questions but are very broad cannot be answered in a chat or three but instead will require serious effort and study. There really is little substitute for the tutorials -- other than taking a class or hiring a tutor.

    You will probably find here that the more specific your question, the better we'll be able to answer it. For instance, if you ask about "A program that will import a graphic?" most will refer you to a tutorial. If on the other hand you state, "I tried to display a graphic as a background image in my JPanel with the code below, but instead of showing the picture, it showed xxxxx...
    Java Code:
    // your code would go here
    "
    You'll get much more specific help and probably code examples.

    Best of luck.
    Last edited by Fubarable; 12-25-2009 at 11:12 PM.

  3. #3
    fresh83 is offline Member
    Join Date
    Dec 2009
    Posts
    55
    Rep Power
    0

    Default

    id like code for the most basic import image program someone can create.
    from there, id like to know if i wanted to create a program using graphics i made. would i cut up the picture? or dose is there a code for useing a image as a background of your gui?

    i guess for starters i want to create a program that uses a bg i created,
    have a few buttons and places for user input and expand from there.


    whats the standrd for doing this?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by fresh83 View Post
    id like code for the most basic import image program someone can create....
    Sorry to sound like a broken record, but your best bet is still to study the tutorials and try to create such a program yourself from what you learned. Then please feel free to come on back with your code if it doesn't work or if you have any specific questions.

    Edit: for background images, also please look here: BackgroundImageOnJPanel

    Also, you'll find lots of code examples here if you search the forum, as well as the other main Java forums and of course through Google.

    Much luck!
    Last edited by Fubarable; 12-26-2009 at 12:03 AM.

  5. #5
    fresh83 is offline Member
    Join Date
    Dec 2009
    Posts
    55
    Rep Power
    0

    Default

    you do sound like a broken record, def a programmer. but i have studied the tuts...and i am a human , not a computer. i learn through a combination of human interaction and studying . so i will wait for a human to come along to ask some specific questions to .... if i ask for the code to code one image and another human gives it to me there is a small chance of it being wrong around here ...where has if i go find it myself it will take longer, i will be unsure of it and i could be doing things the hardway. u asked for specific questions and i asked. i

  6. #6
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    Quote Originally Posted by fresh83 View Post
    i learn through a combination of human interaction and studying . so i will wait for a human to come along to ask some specific questions to .... if i ask for the code to code one image and another human gives it to me there is a small chance of it being wrong around here ...where has if i go find it myself it will take longer, i will be unsure of it and i could be doing things the hardway. u asked for specific questions and i asked. i

    No-one who has read the plentiful and useful advice given by Fubarable would harbour any doubt that he is indeed a human being. Your snide suggestion to the contrary reflects more on the lack of your humanity than his.

    If you're worried about how long serious study will take, get started right away! Rather than fret that you might be doing things the hard way, acknowledge that the alternative is to be left in your current state of not being able to do things at all.

    As for waiting about to be thrown code trinkets to play with, that's not learning to write code. Even Alexander the Great (and he could do things) when he wanted to cut through the bothersome business of proceeding step by step through his studies, had to be content with being told: "Sire, there is no royal road..."

  7. #7
    fresh83 is offline Member
    Join Date
    Dec 2009
    Posts
    55
    Rep Power
    0

    Default

    .....*** ****i hate how programmers think.

    Its black and white and thats all there is.

    ....Listen, i have studied my *** ****BRAINS out the last 2 weeks with no human help. Ive done **** the hard way and made ****alot harder than it had to be but, at the end of the day . i can only take in x amount of information b4 im just mindlessly reading. Human learning is much more complex than that , by getting information from a diverse set of resources, aka chat, phone calls , tuts , pictures... ur brain makes more connections . connections are the root of all intelligence.


    Just because all the information is on the page dosnt mean that i will learn it best from reading it .Now if someone wants to step to the plate and have a back and forth convo...please it would be appreciated.
    Last edited by Fubarable; 12-26-2009 at 02:59 AM. Reason: Profanity removed

  8. #8
    fresh83 is offline Member
    Join Date
    Dec 2009
    Posts
    55
    Rep Power
    0

    Default

    and telling me that playing with code wont teach me anything is b.s as well ...im a professional graphic and web designer , self taught and thats how i learned the ENTIRE adobe creative suite....U may learn nothing by tinkering with stuff but, i learn everything from backwards engineering and asking q's not text books.

  9. #9
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    235
    Rep Power
    6

    Default

    This is very messy because I wrote it very fast. Anyway, you can't really complain. If you have any questions about the code, feel free to ask.

    Java Code:
    import javax.swing.*;
       import java.awt.*;
       import java.io.File;
       import java.awt.event.*;
       import javax.swing.*;
    
        public class BackgroundSample extends JFrame implements ActionListener {
       
          Container content;
        
           public BackgroundSample()
             {
             content = this.getContentPane();
             
             JMenuBar menuBar = new JMenuBar();
             
             JMenu fileMenu = new JMenu("File");
             fileMenu.setMnemonic(KeyEvent.VK_F);
             menuBar.add(fileMenu);
             
             JMenuItem openAction = new JMenuItem("Open...", KeyEvent.VK_O);
             openAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
             fileMenu.add(openAction);
             openAction.addActionListener(this);
             
             setJMenuBar(menuBar);
             }
           public void actionPerformed(ActionEvent e) {
             ImageIcon imageIcon = getImageIcon();
             if (imageIcon == null)
                return;
             setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
             setImage(imageIcon);
             }
           public void setImage(ImageIcon Icon)
             {
             final ImageIcon imageIcon = Icon;
             JPanel panel = 
                 new JPanel() {
                   Image image = imageIcon.getImage();
                      {
                      setOpaque(false);}  
                    public void paintComponent (Graphics g) {
                      g.drawImage(image, 0, 0, this);
                      super.paintComponent(g);
                      }
                   };
             JScrollPane scrollPane = new JScrollPane(panel);
             
             content.removeAll();
             content.add(scrollPane, BorderLayout.CENTER);
             panel.revalidate();
             }
           public ImageIcon getImageIcon()
             {
             File imageFile;
             
             JFileChooser fc = new JFileChooser();
             int returnVal = fc.showOpenDialog(this);
             if(returnVal == JFileChooser.APPROVE_OPTION) {
                imageFile = fc.getSelectedFile();
                } 
             else { 
                return null; }
             return new ImageIcon(imageFile.getAbsolutePath());
             }
    
           public static void main(String args[]) {
             JFrame frame = new BackgroundSample();
             frame.setTitle("Java Picture Viewer");
             frame.setSize(250, 250);
             frame.setDefaultCloseOperation(3);
             frame.setVisible(true);
             }
          }

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    .....g** d**** i hate how programmers think.
    I understand your frustration as learning Java is no easy task, but please watch your language. This can get you banned here.
    Last edited by Fubarable; 12-26-2009 at 03:46 AM.

  11. #11
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    i have studied my *** ****BRAINS out the last 2 weeks with no human help
    Shit man, welcome to programming. I've spent the last 2 years getting a masters in this stuff without human help. I have to agree with others, if you took 5 min to read Fubarable's posts, you'd see he is more helpful than anyone else here. If you need to vent, scream into a pillow, don't take it out on forum members.

  12. #12
    CodesAway's Avatar
    CodesAway is offline Senior Member
    Join Date
    Sep 2009
    Location
    Texas
    Posts
    238
    Rep Power
    6

    Default

    Quote Originally Posted by fresh83 View Post
    im a professional graphic and web designer , self taught and thats how i learned the ENTIRE adobe creative suite
    So, why are you complaining about reading a tutorial?? You can't complain that the forum users are referring you to tutorials - so that you can experiment and be self-taught, and then mention how you self taught yourself the skills you need... it doesn't work like that.

    Quote Originally Posted by fresh83 View Post
    i hate how programmers think.

    Its black and white and thats all there is.
    I wouldn't say that that's all there is, but yeah, many things are blank and white - it either does what you want or it doesn't. However, HOW you get there may be vastly different depending on how you approach the problem - there really isn't a "best" way always. Many times, it's about experimenting and figuring out what does and doesn't work.
    CodesAway - codesaway.info
    writing tools that make writing code a little easier

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

    Default

    Quote Originally Posted by fresh83 View Post
    .....*** ****i hate how programmers think.
    Its black and white and thats all there is.
    Programmers have to think that way because that's the way their subjects (computers) think. Those things are way too stupid to understand 'nuances' and other subtle interpretations; i.e. if it is ambiguous, it's an error. If you hate the way programmers think you must hate those stupid computers.

    kind regards,

    Jos

  14. #14
    AndreB's Avatar
    AndreB is offline Senior Member
    Join Date
    Dec 2009
    Location
    Stuttgart, Germany
    Posts
    114
    Rep Power
    0

    Default

    Yoda: "I cannot teach him. The boy has no patience."
    Obi-Wan: "He will learn patience."
    Yoda: "Hmm. Much anger in him, like his father."
    Sorry, but you have to be patient.

    Starting from your questions:
    > How do i create something physical?
    Wtf ? What do you mean ?

    > a program that will take user input?
    1. google: "java input"
    2. open the first link
    3. I/O from Commandline (java.sun.com/docs/books/tutorial/essential/io/cl.html)

    > A program that will import a graphic?
    A very general question. Ando to that only a general answer exists. Use packages and classes for graphics. Like ImageIO class.

    > Where do graphics pop up if i do code them ?
    They "pop up" in your code. Only if you make them pop up in your code they pop up in yout application

    > if you import a class do you have to understand how it works or just know how to use it in your own classes?
    Depends. It it important which form an apples has if you want to eat it or is it important how it tastes if you want to draw it ?

    > How do i code a program that can be double clicked and open on the desktop. even if it just says hello world.
    Your just code. And the run the intepreter (java) on your class.


    I assume you are not pleased, but please. Stay calm. No-one is born a master.
    And if it were so easy, there would not be any problems in the world in programming.

    And remeber:
    Fear leads to anger; anger leads to hate; hate leads to suffering.
    Much to learn you have!

  15. #15
    fresh83 is offline Member
    Join Date
    Dec 2009
    Posts
    55
    Rep Power
    0

    Default

    No theses are all great responses ...

    i also ran into this:
    java.sun.com/docs/books/tutorial/uiswing/examples/components/index(dot)html#table


    and it sums up alot of my questions or at least gave me enough to play with for a while.
    im actually coming along rather fast i think. Im going to work on a program that summarizes the project im working on and includes all employees and a profile for each of them with a tree to view our business plan and password protected.


    ive put together a master list of going from 0-Java/android programmer with some REALLY good resources that i will post when i have 20 posts.


    As far as the comment about things really being black and white, no , no there not . theres a reason your the computers master and not vice versa. we are complex...and although it may compute in your head that all info being on this page =all questions answered ...its not that simple , im smart enough to find tuts and i assure you I AM useing many many tuts everyday, but sometimes id like to take a break . have a open conversation and ask some questions that might seem dumb to start but , will lead to information a tut wouldnt tell me . Thats why we have forums .


    Im not mad at anyone and i thank you all for helping even if i seemed like a ahole earlier . Im just looking for a good group to converse with .

  16. #16
    fresh83 is offline Member
    Join Date
    Dec 2009
    Posts
    55
    Rep Power
    0

    Default

    Collin ill take a detailed look in a sec but, what dose this program do? replace the BG? and codes a few pics?

  17. #17
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    235
    Rep Power
    6

    Default

    you go to file open, and you can open pictures and view them.

  18. #18
    fresh83 is offline Member
    Join Date
    Dec 2009
    Posts
    55
    Rep Power
    0

    Default

    Collin would i be able to talk 2 you for a min on aim or fb?

Similar Threads

  1. creating archives
    By almaz__ in forum Java Applets
    Replies: 2
    Last Post: 09-27-2009, 05:30 PM
  2. Creating files stopped creating...
    By Dieter in forum Advanced Java
    Replies: 3
    Last Post: 09-26-2009, 12:45 AM
  3. Creating Indexes
    By gilbertsavier in forum JDBC
    Replies: 0
    Last Post: 07-17-2009, 08:23 AM
  4. Replies: 1
    Last Post: 07-02-2008, 02:57 PM
  5. creating .ear file
    By psn in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 01-06-2008, 06:01 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
  •