在jTextArea中设置不同的字体格式

时间:2016-02-14 20:26:19

标签: java string swing fonts jtextarea

我正在jTextArea中打印一些发票记录,如下所示:

var mongoose = require('mongoose');
    var Schema = mongoose.Schema;
    var p = new Schema({
    deadline: {
            type: Date,
            required: [true,'Deadline is required'],
            min: [new Date(+new Date + 20*60000),'Min deadline'], //in 20 minutes
            max: [new Date(+new Date + 365*24*60*60000),'Max deadline'] //in 1 year
        }
    });

框架内的文字为 +----------------------------------------+ | V.K Autos Larkana | | Near Rehmaniya Masjid Larkana | | Police Shopping Center Larkana | | Cell: 0334-3269198, 0333-3910951 | | | | CUSTOMER INVOICE | +--------------------+-------------------+ |INFO |CUSTOMER | +--------------------+-------------------+ |DATE: 2016/01/28 |Mohammad Rafi Abro | |TIME: 15:31:15 |Bill No:10 | +--------------------+-------------------+ | SELLING DETAILS | +----------------+-----+-------+---------+ |ITEM | QTY| Rate| Total| +----------------+-----+-------+---------+ |nuts | 12| 25| 300| |70 CC | 12| 7000| 84000| |125 CC | 13| 95000| 1235000| |12 | 25| 2500| 62500| +----------------+-----+-------+---------+ | Sub Total| 1381800| +------------------------------+---------+ | ------Thank you for your visit------ | +----------------------------------------+ | ******** Soulution by AbroSoft ******* | | * abrosoft@outlook.com # 03337584273 * | +----------------------------------------+ ,取自不同的变量或String, 我想在其中加粗一些文字,如公司名称应为粗体,地址应为斜体或标题应为粗体,如下所示:

V.K Autos Larkana
在Rehmaniya Masjid Larkana附近 警察购物中心Larkana
单元格:0334-3269198,0333-3910951

我写的代码如下:

jTextField

注意:这是此link

后面的收据打印机格式

0 个答案:

没有答案