Here you can find the source of createStyle(String logicalName)
public static Style createStyle(String logicalName)
//package com.java2s; //License from project: Apache License import javax.swing.text.Style; import javax.swing.text.StyleContext; public class Main { public static final StyleContext styleContext = new StyleContext(); public static Style createStyle(String logicalName) { Style result = styleContext.addStyle(logicalName, null); return result; }// w w w .j a v a 2 s . co m }