All you need is a wrapper that can be written quickly. You can also use your own .NET objects or events here. And even if you don’t expect it, because you have to communicate via Java to .NET and back to Java, the performance is really good.
Such a Javonet based wrapper for the List & Label .NET component has now been developed in cooperation – including a suitable Eclipse Java example, which can be downloaded from GitHub and contains a detailed description.
.NET code with easy data binding and printing:
private void OnButtonPrintList() { ListLabel LL = null; try { LL = new ListLabel(); // attach the preview control LL.PreviewControl = this.LLPreviewControl; // bind to the DbCommandSetDataProvider LL.SetDataBinding(CreateDbCommandSetDataProvider(), "Products"); // set the default project name LL.AutoProjectFile = "simple.lst"; // choose a list project LL.AutoProjectType = LlProject.List; // call the print method LL.Print(); } catch (LL_User_Aborted_Exception ex) { // ignore this exception } catch (ListLabelException LlException) { MessageBox.Show("Information: " + LlException.Message + "nnThis information was generated by a List & Label custom exception.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error ); } finally { if (LL != null) { LL.Dispose(); } } }
Java code that maps the identical .NET code using the Javonet wrapper:
private void OnButtonPrintList() { ListLabel LL = null; try { LL = new ListLabel(); // attach the preview control LL.setPreviewControl(this.LLPreviewControl); // bind to the DbCommandSetDataProvider LL.SetDataBinding(CreateDbCommandSetDataProvider(), "Products"); // set the default project name LL.setAutoProjectFile("simple.lst"); // choose a list project LL.setAutoProjectType(LlProject.List); // call the print method LL.Print(this); } catch (LL_User_Aborted_Exception ex) { // ignore this exception } catch (ListLabelException LlException) { JOptionPane.showMessageDialog(null, "Information: " + LlException.getMessage() + "nnThis information was generated by a List & Label custom exception.", "Information", JOptionPane.ERROR_MESSAGE); } finally { if(LL != null) { LL.Dispose(); } } }
List & Label in Java can now be used just as easily as directly in .NET. So far, the wrapper does not yet map the entire List & Label .NET component, but the very easy .NET data binding and the associated design and print calls are already included. And best of all, the Javonet Wrapper’s GitHub project allows you to easily implement your own extensions yourself.
Daniel has undergone training as a software developer at combit, where he currently leads the Customer Support department as a manager. His responsibilities extend beyond software development to include technical collaborations with business partners. He conducts workshops for developers and serves as a technical advisor to the sales and service team. Outside of work, Daniel is an avid cyclist, frequently seen navigating the trails around Lake Constance and the neighboring Alps on his mountain or road bike. Additionally, he dedicates time to practicing Chinese martial arts, including Wushu Kungfu and Taichi.