Handy dandy Netbeans feature: Print to HTML


In blogging, I often like to share some code.  Often times, I’ll just take a screen print, crop it, and upload it.   But yesterday I found another way to put formatted code in my posts using Netbeans:  Print to HTML.  It’s under the File menu.

  1. Open your source in Netbeans
  2. Click Print to HTML under the File menu
  3. Choose between “Print to File” and “Print to Clipboard
    
  4. Click the HTML tab (assuming you’re using WordPress
  5. Paste in markup into your blog editor…et voila!


1
/*

 2  * To change this template, choose Tools | Templates
 3  * and open the template in the editor.
 4  */
 5
 6 package sample.transfer;
 7
 8 import java.math.BigDecimal;
 9
10 /**
11  *
12  * @author david ctr wilson-bur
13  */
14 public class ProductTO {
15     private Integer productId;
16     private String description;
17     private BigDecimal purchaseCost;
18
19     public String getDescription() {
20         return description;
21     }
22
23     public void setDescription(String description) {
24         this.description = description;
25     }
26
27     public String getManufacturerName() {
28         return manufacturerName;
29     }
30
31     public void setManufacturerName(String manufacturerName) {
32         this.manufacturerName = manufacturerName;
33     }
34
35     public Integer getProductId() {
36         return productId;
37     }
38
39     public void setProductId(Integer productId) {
40         this.productId = productId;
41     }
42
43     public BigDecimal getPurchaseCost() {
44         return purchaseCost;
45     }
46
47     public void setPurchaseCost(BigDecimal purchaseCost) {
48         this.purchaseCost = purchaseCost;
49     }
50     private String manufacturerName;
51
52
53
54 }
55
56
Advertisements

One thought on “Handy dandy Netbeans feature: Print to HTML

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s