Sunday, December 20, 2009

Scorpio Men Like To Flirt

Place a jar in the Palette of NetBeans

image often develop JAR files that we have them always at hand (but if they are visual), an alternative to hold the jar at hand is to add it in the NetBeans palette.

This entry will place a library (JCalendar) in the NetBeans palette to drag your items to our JFrame, for this example I will use the library that can JCalendar downloaded from this page: http://www.toedter.com/en/jcalendar/index.html (the project is free).

  1. In the Component Palette (beans) and right click the popup menu select Palette Manager: image
  2. We click New Category, and in the popup window will place the name of the category you want to appear in the palette (Note that if you uncheck the checks the category selected disappears from the palette). image
  3. Now let's add the jar to the palette, for this go to "Add from JAR "and search the directory of the JAR to add, select, and we click on Next: image
  4. In the next window select the components to add: image
  5. select the category that had created, click Finish and close the window image
  6. And we are ready and Jar in our palette of components that can drag the frame or panels: image

Tuesday, December 8, 2009

Mobile 3gp Free Kates Playground

Get the source code from the JAR

120px-Nuvola_mimetypes_java_jar Well often we find projects in order to study the author gives us only the jar file but not the source code. Here I found an easy way to get the source code, EYE that this should only be used for purposes of understanding the code (it is good to see how other people as scheduled.)

First of all we have installed winrar, go to the jar file → right click and unzip it. image

Once you've unpacked the JAR file will meet at the folder files with the extension. class who are vain to interest us: image

Now we downloaded DJ.Java.Decompiler.v3 portable tool. 11/11/1995 that can be downloaded from here . image

DJ.exe execute the file, we will leave the following screen ... . we go to File → Open and search the files. class: image

And then we have the source code of our JAR file

image

Are You Supposed To Get Dry On The Shot

Window splash with NetBeans

image A splash window is a display window, without the classic buttons and it will serve to give a better presentation to our project.

This window should be placed at the beginning of our application, to start we need to design what will be our display picture which for reasons of time I chose NetBeans, and this we will add a progress bar

  1. Open the NetBeans and create a new project, which it believes not to uncheck the class main: image
  2. Create the folder where our image will be testing it right click on Source Package → New → Other so leave a window in which we choose Other → Folder and finally we give the name you want: image image
  3. Splash Now create a package in which we will add a JFrame and create a class for the thread you'll use, so they should be well: image
  4. We will work on our frame, which you right click and give → BorderLayout setLayout done put two panels: one on the south and one in the center (follow the order to avoid complications). After you have added the panels to each BorderLayout we will give as the frame. Done this we will place in the south a JProgressBar panel which we will call that progress and the central panel a label, we should look like: image
  5. To change the name we give JProgresBar right click on the bar and choose "Change Variable name" then we will leave the following window in which we place the name of the bar: image
  6. In the central panel will place a label to which we will Put a picture, view this entry to see how an image ç Place: image
  7. JFrame In the designer we will add code to do this we click on button image source, and and in the JFrame class (which call Principal) we add an object Thread:
     import java.awt.Color; 

    public class Main extends javax.swing.JFrame {
    HiloProgreso
    thread;


  8. We
  9. to the manufacturer and we add the following code: public
     Main () {

    / / default method
    initComponents ();
    iniciarSplash ();
    / / Create an object which
    HiloProgreso / / we pass as parameter the progress bar thread = new HiloProgreso
    (progress);
    / / Start the thread
    hilo.start () ;
    / / We give our size and position
    this.setLocation Frame (200.200);
    this.setSize (472.249);
    / / Free resources
    thread = null;}



  10. create a get method for our JProgressBar, for it or add it directly or do that NetBeans generates it, for this right click on the select Refactor → attribute → select Encapsulate Fields and in the window that appears just select the set and get methods that we want to generate image NetBeans image


  11. then appears as follows line of code: public
     javax.swing.JProgressBar getjProgressBar1 () {return 
    progress;}



  12. Now if we can creat our method starting Splash:
     iniciarSplash public void () {
    this.getjProgressBar1 ( ). setBorderPainted (true);
    this.getjProgressBar1 (). SetForeground (new Color (50, 50, 153, 100));
    this.getjProgressBar1 (). SetStringPainted (true);}



  13. NetBeans we should be marking Error This is because we have not created our class HiloProgreso; for this package click Splash → New → Java Class and the class name we give HiloProgreso and we do that extends Thread, in this class must create a reference to progress bar that we pass parameters to which we declare a JProgressBar progress:
     Splash package; 
    import
    javax.swing.JProgressBar;
    public
    HiloProgreso class extends Thread {
    JProgressBar
    progress;



  14. Now let's create our constructor method which will have as parameters a progreso1 bar, it should be noted as given the partnership that is the reference the object passed as parameter the reference assigned to the previously believed and that I can use all the methods (the super method is to call the constructor of the Thread class and by law must be the first line in the constructor of the class daughter):
     HiloProgreso public class extends Thread {
    JProgressBar
    progress;
    public
    HiloProgreso (JProgressBar progreso1)

    {super ();
    this.progreso = progreso1;}



  15. done this we will create the run method that will serve to draw the thread:
     public void run () {

    for (int i = 1; i \u0026lt;= 100; i + +) {

    progreso.setValue (i);
    pause (100);
    }}



  16. And finally we break our method, which As the name suggests will give us pause for no progress bar reaches 100% n let us run the application:
     public void pause (int mlSeg) 

    {try {

    / / pause for the splash
    Thread.sleep (mlSeg)
    } catch (Exception e) {}}



  17. This done press F6 and you see something like this: image


  18. The example can be downloaded from here:





btn_6







* If the download link does not work, please go to the shared folder that section is right, this will send them directly to my shared folder in the shared folder → go to Examples Java Examples → → → Cap_18_NetBeans Splash.



* For an application call ended after splash time I would ask you to modify the application and to do that (no later than tomorrow I'm changing)

Wednesday, December 2, 2009

Canon A640 Kijiji Canada

Connecting SQL Server and NetBeans using JDBC - Part 2

Dibujo Hello first of all I apologize for delay in publishing this post ... I had some problems with the PC but everything is good and under and we will see the second part of the connection between SQL Server and NetBeans. In order to carry out the connection to our database with our application in Java need to make some adjustments before SQL Server 2005; adjustments to be made are in this post (If you have already reviewed this post would be good to review it again because it has made some adjustments).
done this the next step is to configure NetBeans to end our connection to the database data:
I. - Conditions
  • have set the Microsoft SQL Server 2005, but did you check out this entry :
  • NetBeans IDE
  • SQL Server Connector for Java, which can be downloaded here .
  • An application in Java, but here you'll create a simple.
  • The Pubs database, if not please add to your database You can do this form.
II .- CREATION PROJECT
  • Open the NetBeans and create our project in which we will put a JPanel (PanelPrincipal) and JFrame (Main), go to PanelPrincipal to which we give Border Layout, in the north and place a button in the center of a Text Area:
numcommentsVE
NOTE: Before positioning Txt Area is recommended to add a JScrollPane to display content that exceeds the limits of textArea

image image

  • Now we go to the JFrame called Home where we add the previously created panel:
     public Main () {

    initComponents ();
    add (new PanelPrincipal ());
    setSize (500.400);}








III .- ADDING TO PROJECT JAR



  • Unzip the connector had downloaded previously. image


  • And we will find the following folders: image


  • add the libraries sqljdbc4 sqljdbc and our project for this right-click the Add JAR Libraries → image & # 160; image







IV .- ESTABLISHING THE CONNECTION



  • We go to the panel Panel pricipalmente name and import the following libraries: import java
     . sql.Connection; 
    java.sql.DriverManager import;
    import java.sql.ResultSet;
    java.sql.ResultSetMetaData import;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util . logging.Level;
    java.util.logging.Logger import;



  • We will design graph and we double-click the Browse button to set your action and we add the following code: private void
     btnConsultaActionPerformed (java.awt.event.ActionEvent evt) {String 
    connectionUrl = "jdbc: sqlserver: / / localhost: 1433; "+
    " databaseName = pubs; user = sa, password = adminadmin; "
    / / Declare the objects sioguientes
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;

    try {/ / establish the connection
    Class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    con = DriverManager.getConnection(connectionUrl);
    // Create and execute an SQL statement that returns some data.
    String SQL = "SELECT * FROM AUTHORS";
    stmt = con.createStatement();
    rs = stmt.executeQuery(SQL);
    this.muestraData(rs);
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }
    finally {
    if (rs != null) try { rs.close(); } catch(Exception e) {}
    if (stmt != null) try { stmt.close(); } catch(Exception e) {}
    if (con != null) try { con.close ();} catch (Exception e) {}}


    }



  • Finally we create our method public void
     muestraData muestraData (ResultSet r) throws Exception {
    ResultSetMetaData
    rmeta = r . getMetaData ();
    ();// int numColumnas = rmeta.getColumnCount many columns
    txtSalida.setText
    (""); for (int i = 1; i \u0026lt;= numColumnas; + + i)
    / / get column name
    txtSalida.append (rmeta.getColumnName (i) + "\\ t");
    txtSalida.append ("\\ n");
    while (r.next ())
    {/ / until EOF
    for (int i = 1; i \u0026lt;= numColumnas; + + i) {

    txtSalida.append (r.getString (i) + " \\ t ");}

    txtSalida.append (" \\ n ");
    }}



  • done this run the project and we will leave as follows: image


  • Example you can download it here: btn_6











V. - ERRORS



  • needs updating to SQL Server 2005 Service Pack 3 for this to work.

Best Dvd Upconverting Bluray Player

Netbeans Connecting with SQL Server and JDBC - Part 1

Dibujo This first tutorial will attempt to show the adjustments that must be done in sql server 2005 to connect it to netbeans, so we will need some tools and pubs database previously downloaded and attached to our SQL, but you have the pubs database, you can look at this post or you can use any database you have.

I. - Conditions
  • Microsoft SQL Server 2005.
  • Microsoft SQL Server JDBC Driver, and if not you can download it here . NetBeans IDE
II .- OBSERVATIONS
  • By default, the SQL Server 2005 does not allow connections remote and the sa account is disabled, so if we try to connect displays the following error message:
  • Another problem can arise when we wish to connect is that TCP / IP connections are disabled, for which the deal to connect us to display the following exception:

    Network error IOException: Connection refused: connec

III .- SQL SERVER SETTING THE STEP BY STEP
  1. ENABLE TCP / IP : We
    • the Start menu → Programs → Microsoft SQL Server 2005 Configuration → Tools → SQL Server Configuration Manager: image
    • The left side of the window of the SQL Server Configuration Manager, we will expand the choice Network Configuration SQL Server 2005, click Protocols for SQLEXPRESS and we right click on TCP / IP and choose the option to enable (by doing this will get a warning that changes will not take effect until you restart the service ) image
    • Now go to the TCP / IP and headed IP Address tab → IPALL and change the dynamic port value for the value of 1433 (this value is necessary when trying to connect with netbeans) ; again to accept the warning we will restart for the changes to take effect: image
    • Now we will restart the service, for this we go to the left pane click the option → Services → SQL Server 2005 and go to the right pane in SQLEXPRESS and we restart: image image image
  2. ENABLING CONNECTION DUAL MODE : SQL SERVER AUTHENTICATION AND WINDOWS AUTENTICCIÓN Login
    • SQL Server Management Studio 2005 in Windows Authentication mode: image
    • In Explorer, right-click the instance name and select properties. image
    • Select the Security tab and change the authentication mode from Windows to Windows Authentication Mode and SQL Serv er image
    • Then we will get a warning which indicates that the changes will take effect when s restart SQL Server (this we will do later.) image
    • We're going to the instance and restart: image
  3. ENABLE REMOTE CONNECTION TO THE SURFACE CONFIGURATION :
    • Open
    • surface configuration is SQL Server 2005 image
    • Select Surface Area Configuration for Services and Connections: image
    • expanded the instance of SQLEXPRESS → Engine → Database Connection remote and select (on the right side): Local and remote connections → Using TCP / IP and named pipes: image
    • Services In the tab, change the startup type to Automatic and we to accept (again we will get a warning that indicates that you have to restart the service): image
    • SQL Server Log Management Studio 2005 in Windows Authentication mode.
    • In the right pane, go to Security → Login and user sa look right click → Properties: image
    • In the properties we enter a password for this user and the status tab give permits connection database and log on: image image
    • Now we can only restart the service for the changes to be made: image

duke NOTE: If trying to restart the SQL Server service error occurs is because you must enter administrator mode, and for this we click icon in the SQL server → Run as administrator.

image

Well here we have already given permission to user "sa" for remote connection can be made using the dual boot is twice Login:

image

image