现在我正在使用NetBeans附带的GUI构建器在Java应用程序中工作.
但是我发现了一些奇怪的bug /功能,因为我不再能够看到允许用户在"source"和"design"之间切换的窗口(Design是拖放NetBeans gui builder而source是代码你可以在哪里添加自己的方法等等).
注意:红色是不必要的删失信息.

当我右键单击组件以添加事件代码时,它会将我带到源代码(没有窗口让我更改回设计,当我关闭并重新打开它时,它会回到设计中).所以我知道NetBeans认识到这确实是JFrameNetBeans GUI设计器的一种形式,源代码确实可用.
我在这个网站或网上找不到这个问题的任何答案,我试过重置窗户但是没有用,当我点击窗口选项时我也找不到窗口.我确信有一些简单的问题,但我无法找到它.如果这是一个简单的问题,请原谅我.
我有一个与Java热敏打印机通信的应用程序,并使用Star tsp 100打印机使热敏打印机打印带有条形码/强调/不同尺寸等的收据.
我可以让程序打印出我喜欢的东西,但打印机很慢.我相信原因是我使用非优选的方式/方法发送字节命令.
public static void Command(byte[] bytes) throws Exception{
//The bytes array is the argument, consisting of a byte[] array such as
//byte[] Emphasis = {0x1B, 0x45}; //Which gives the text boldness.
//And Command(Emphasis); To execute the command with this method.
DocPrintJob job = PrintServiceLookup.lookupDefaultPrintService().createPrintJob();
DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
Doc doc = new SimpleDoc(bytes, flavor, null);
job.print(doc, null);
}
Run Code Online (Sandbox Code Playgroud)
当我想打印一个字符串我使用这种方法.
public void PrintString(String s) throws Exception{
DocPrintJob job = PrintServiceLookup.lookupDefaultPrintService().createPrintJob();
System.out.println(job + " <- printer");
DocFlavor flavor = …Run Code Online (Sandbox Code Playgroud)