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;
 910 /**11  *12  * @author david ctr wilson-bur13  */14 public class ProductTO {
15     private Integer productId;
16     private String description;
17     private BigDecimal purchaseCost;
1819     public String getDescription() {
20         return description;
21     }
2223     public void setDescription(String description) {
24         this.description = description;
25     }
2627     public String getManufacturerName() {
28         return manufacturerName;
29     }
3031     public void setManufacturerName(String manufacturerName) {
32         this.manufacturerName = manufacturerName;
33     }
3435     public Integer getProductId() {
36         return productId;
37     }
3839     public void setProductId(Integer productId) {
40         this.productId = productId;
41     }
4243     public BigDecimal getPurchaseCost() {
44         return purchaseCost;
45     }
4647     public void setPurchaseCost(BigDecimal purchaseCost) {
48         this.purchaseCost = purchaseCost;
49     }
50     private String manufacturerName;
51525354 }
5556

Thanks for reading!  If you would like to see what else I’m up to, check out Whiff

One comment

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s