Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

larsp777

@larsp777
About
Posts
86
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • When to use ASP.NET Webforms, MVC, Web API
    L larsp777

    Oh, to bad. I have looked as some videos and in some ways it is easy to understand but then again not :) Thanks anyway! Edit: I saw the link in the email I got from the post so I see the video there. Thank you!

    ASP.NET

  • When to use ASP.NET Webforms, MVC, Web API
    L larsp777

    Ok, thanks!

    ASP.NET

  • When to use ASP.NET Webforms, MVC, Web API
    L larsp777

    Ok, I see. Thanks! By the way, do you know of any good MVC 5 tutorial? I have tried some but they seem to get to comlicated to fast.

    ASP.NET

  • When to use ASP.NET Webforms, MVC, Web API
    L larsp777

    Ok, thanks! Kind of what I guessed. Still a bit confusing that you can start a project as Web API I think. Feels like you should start MVC and then Add Web API. But I think I have to read more about it.

    ASP.NET

  • When to use ASP.NET Webforms, MVC, Web API
    L larsp777

    ASP.NET has become increasingly complex. Webforms was the old but still valid technique. MVC means you can stucture your application better and have more controll. So is Web api a third technique or should I use it to create webservices and other things. So my questions is: Is Web Api a third technique to be used instead of webforms and MVC?

    ASP.NET

  • Code special to MVC
    L larsp777

    Hm, so when do you use this? Feels like everything I thought my students about private variables and getters and setters is obsolete... Here´s something to put in my signature. The more I learn the more I realize how little I know...

    .NET (Core and Framework)

  • Code special to MVC
    L larsp777

    I will absolutely!

    .NET (Core and Framework)

  • Code special to MVC
    L larsp777

    Well, as said, I realized that it was in your signature and again, I apologize humbly. Yes, I been a teacher for C# beginners but have alot to learn myself obviously :)

    .NET (Core and Framework)

  • Code special to MVC
    L larsp777

    As I said I misunderstood. It was the signature, not aimed at me. Yes, he did answer my question and thanks for the further clarification.

    .NET (Core and Framework)

  • Code special to MVC
    L larsp777

    Oh, really sorry! Realize now that it was in your signature. again, I apologize.

    .NET (Core and Framework)

  • Code special to MVC
    L larsp777

    I think adding the "Seriously, do it" was unnecessary, like I was some idiot. You could have only said "please read this" or something.

    .NET (Core and Framework)

  • Code special to MVC
    L larsp777

    Read this. Seriously, do it. "If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome" "Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid"

    .NET (Core and Framework)

  • Code special to MVC
    L larsp777

    Saw this in an example when setting properties. Is this some kind of special ASP.NET MVC syntax?

    var movie = new Movie() {
    Name = "Shrek!"
    };

    Where Name is a property of the class Movie.

    .NET (Core and Framework)

  • Problem adding source to sitemap.
    L larsp777

    I added a sitemap and then chose that as a source. Then I get this:

    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Host 'fe80::ad93:da36:44e1:3cca%11' is not allowed to connect to this MySQL server

    Source Error:

    I never chose MySQL, what is going on?

    ASP.NET

  • Serializing object to disc. Only retreives one object.
    L larsp777

    I meant upvote, sorry. For my other question I think I shown all code, but can post if again of course. Anyway I think I found a solution. Added this: repaint(); revalidate(); Seem to work. Not sure if the order matters.

    Java

  • Serializing object to disc. Only retreives one object.
    L larsp777

    I meant how can I upgrade your answer to give you credit :) Sure I can start a new question if you want. All I do though is call the class I shown in main like this: new MainFrame(); And then I inherit from the main window like: public class MainFrame extends JFrame implements ActionListener { So most code is in the constructor. So should I post a new question?

    Java

  • Serializing object to disc. Only retreives one object.
    L larsp777

    Well, are very greatful. Don't really know how to upgrade, could you tell me? Also, I have another question and hope it is ok to ask it here. When I start the window it is blank or only a few items. When I minimize the window and maximaze it again, everything is fine. Do you know why this is?

    Java

  • Serializing object to disc. Only retreives one object.
    L larsp777

    Ah, of course! Thank you, so simple :) So, again, thank you very much! So can I mark as solved or give you credit?

    Java

  • Serializing object to disc. Only retreives one object.
    L larsp777

    Ok, I'll try again. This is my total code in a class that inherits from JFrame instantiated from main(). Slightly changed because I come from Sweden. So I enter the info in the textfield for title, author and price. If I enter the info for one book and then press "show books" it works. I enter another book and press show books again it still works. The textarea shows all books. If I enter a book and doesn't press "show books", enter a few others and then hit "show books" it only shows the last entered book. If I have entered a few books using the first method (enter book, press "show books", enter another book, press show books again)and then quits using the Close-button one books is saved, not more.

    import javax.swing.BorderFactory;
    import javax.swing.ButtonGroup;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JRadioButton;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.border.Border;
    import javax.swing.border.EtchedBorder;

    /*
    import java.awt.BorderLayout;
    import java.awt.Color;*/

    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.util.ArrayList;

    public class MainFrame extends JFrame implements ActionListener, MyContacts {

    /\*\*
     \* 
     \*/
    private static final long serialVersionUID = 1L;
    public JTextField txtFieldTitle;
    private JTextField txtFieldAuthor;
    private JTextField txtFieldPrice;
    private JTextField txtFieldLanguage;
    private JTextArea ta1;
    private JButton btn;
    private JButton btn2;
    private JButton btnClose;
    private JButton btnRemove;
    private JRadioButton proRadio;
    private JRadioButton amateurRadio;
    private ButtonGroup playersBtnGroup;
    private ArrayList aList;
    //public ArrayList ProgrammingList;
    private JLabel txtTextArea;
    private JLabel txtTitle;
    private JLabel txtAuthor;
    private JLabel txtPrice;
    private Border redBorder = BorderFactory.createLineBorder(Color.red);
    
    public MainFrame(){ //Construktor
    
    	super("Library");
    	
    	setLayout(null);
    
    	//Sätter storlek på fönstret.
    	setSize(1200, 1000);
    	
    	//Hindra att fönstret kan ändras
    	setResizable(false);
    
    	
    	setDefaultCloseOperation(JFrame.EXIT\_ON\_CLOSE);
    
    	
    	setVisible(true);
    							 
    	getC
    
    Java

  • Serializing object to disc. Only retreives one object.
    L larsp777

    Thanks for your reply. Could you show me some code? I tested to add some objects by writing in the textfields and pressing the button (btn). If I do this for some books and then hit the second button (btn2) it only shows the first book in the list. If I add a book and then hits the second button it show that book. If I add a second book and hits the second button again, it shows both books.

    Java
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups