CellsFactory sınıfını kullanarak Stil nesnesi oluşturma
Contents
[
Hide
]
CellsFactory sınıfını kullanarak Stil nesnesi oluşturma
Aşağıdaki örnek kod, CellsFactory sınıfını kullanarak Style nesnesi oluşturur ve ardından çalışma kitabının Varsayılan Stilini belirler. Başvuru için lütfen çıktı excel dosyasını indirin.
Örnek Kod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(CreateStyleobjectusingCellsFactoryclass.class) + "articles/"; | |
// Create a Style object using CellsFactory class | |
CellsFactory cf = new CellsFactory(); | |
Style st = cf.createStyle(); | |
// Set the Style fill color to Yellow | |
st.setPattern(BackgroundType.SOLID); | |
st.setForegroundColor(Color.getYellow()); | |
// Create a workbook and set its default style using the created Style | |
// object | |
Workbook wb = new Workbook(); | |
wb.setDefaultStyle(st); | |
// Save the workbook | |
wb.save(dataDir + "CreateStyleobject_out.xlsx"); |