To Get A Single Jar File With NetBeans?

Mar 31, 2013

When I click on "Clean and Build" NetBeans generates a .jar file and inside the folder "dist" it add a directory called "lib" with all the java libraries used to implement the program. I would like to achieve with this IDE an unique .jar file that includes everything you need such as Eclipse does by default. Is it possible?

View Replies


ADVERTISEMENT

Swing/AWT/SWT :: Panels Switching On A Single Frame Using Netbeans Builder

Feb 3, 2014

I am writing a ComputerBaseTest application with Netbeans. I have each question on a panel and I want the questions(panels) to be switched, viewing the previous and the next question on a single frame, but I do not know how.

I only understand frame switching if each questn is to be on a frame but each score on each question (frame) do not sum up to give the overall score at the end of the test. Using multi-frame shows a sign of bad programming.

View Replies View Related

How To Load XML File Inside Of Java Class File In Netbeans Project

Feb 26, 2015

try {
File configFile= new File("C: Documents and SettingsstudentMy DocumentsNetBeansProjectsCDASsrcconfig.xml ");
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
doc.getDocumentElement().normalize();
NodeList nList = doc.getElementsByTagName("config");

[Code] .....

This code is working properly but i have use path like this

File configFile= new File("srcconfig.xml");

Instead of system directory path i have to use path inside of project but i am getting an error-cannot find the specified file...

View Replies View Related

Using Data From One Class In Another In Single Java File?

Apr 20, 2015

I am trying to create a second class in a single java file (first time trying this) and want to use data from the first class in the second class but I am not able to do it. What am I missing :

package simplecommissioncalculation;
import java.util.Scanner; // import java.util.Scanner
public class SimpleCommissionCalculation {
public static void main(String[] args) {

[Code] .....

View Replies View Related

Reading Different Types Of Data From A Single Line Of A File?

Oct 12, 2014

I have to read data from a text file and print it in a new text file. An example of one line is like this:
Johnson 85 98 75 89 82

I then have to take the average of all the numbers and assign a "grade" to the numbers for each line of the text file and make a new file so it looks like this for 10 lines:

Name 1 2 3 4 5 Average Grade

Johnson 85 98 75 89 82 85.80 B

My problem is extracting the data from the file so I can use it.

View Replies View Related

JSF :: Using JQuery In Template File With Single And Double Quotes

Jan 5, 2015

I'm learning jQuery to integrate into a JSF application but finding some confusion on the correct syntax especially when it comes to combining double and single quotes in the jQuery scripts. So for this particular page I want jQuery to traverse through a list of documents and put icons next to each document to state what type of document each is (ie: PDF, doc, xls). I can get this to work using normal html markup but I get a Syntax Error - Unexpected Token exception in the browser.

I'm confused about whether this means I need to use the right html references for the JSF element I wish to traverse or whether this is a problem with the way I'm using my quotes.

Also I'm not sure how to correctly reference jsf tags inside jQuery scripts. So for an ordinary html page I execute the following jQuery script:

<script type="text/javascript">
$("document").ready(function () {
$("li a[href = ' .pdf']").after("<img src='myImage'/>");
});
</script>

</code>

Then I have a JSF page with the following commandLink:

<p:column>
<p:commandLink class="downLoadLink" value="Download" ajax="false">
<p:fileDownload value="#{projectDocBean.downloadedFile}"
contentDisposition="attachment"/>
</p:commandLink>
</p:column>

For this page I try to execute the following script:

<script type="text/javascript">
$("document").ready(function () {
$("#downLoadLink = ' .pdf']").after("<img src='myImage'/>");
});
</script>

I get the same syntax error no matter what I put into the script of the JSF page. How to correctly integrate jQuery with JSF.

View Replies View Related

Write Out Multiple BufferedImages To Single TIFF File?

May 28, 2015

I need to write out multiple BufferedImages to a single tiff file. Each image represents a seismic time slice which can be several megabytes in size.  I have used the TIFFEncodeParam.setExtraImages method and saved all my BufferedImages to a vector but my since I create so many BIs I keep running out of memory. Is there a way to create a BI, write it out to a TIFF file, then discard the BI and create the next one?

View Replies View Related

How To Make Java Project A WAR File In NetBeans

May 10, 2014

I am suppose to submit my project as a WAR file but not sure how to do it.

View Replies View Related

How To Load Java File Into Netbeans So Can Work With It

May 12, 2015

I have a couple .java examples I want to mess with but don't know how to get them into Netbeans so I can work with them. What is the process in loading a .java into Netbeans so I can work with the code and run it in Netbeans?

View Replies View Related

Send Single File From A Client To Default Directory Of Server

Aug 8, 2014

I'm trying to do a program that send a single file from a client to a default directory of a Server. The program use the datagramSocket and datagramPacket for the transfer via UDP. The client sent the packet of the file correctly and the server start the receiving but every time the Server class crashes after it's receiving 4/5 packet (exactly 8192 byte)

Then i put the code of the 2 class and the 2 output.

OUTPUT CLIENT:

PROGRAM TRANSFER PACKAGES
name of file is : Doc1.pdf
his dimension: 11408 byte

*** start sending
- 1024 byte
- 2048 byte
- 3072 byte
- 4096 byte
- 5120 byte
- 6144 byte
- 7168 byte
- 8192 byte
- 9216 byte
- 10240 byte
- 11264 byte
- 11408 byte
*** FILE SUCCESFULL SENDED***
BUILD SUCCESSFUL (total time: 3 seconds)

OUTPUT SERVER

PROGRAM TRANSFER PACKAGES
START NEW CONNECTION
Directory: C:prova
Server waiting in port: 9876
Waiting Client...
Name of file is : Doc1.pdf
Dimension : 11408

[Code] ....

In this point the program go in loop and didn't anything. I don't understand how can i resolve it...

SERVER

package udp_pacchetti; 
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

[Code] ...

View Replies View Related

Buffered Writer / FileWriter Not Writing To File In Netbeans?

Apr 2, 2014

I am using netbeans to create a hotel booking system, just tessting out code to get the booking information input to a file when the next button is clicked.

File file = new File("file.txt");
try (BufferedWriter br = new BufferedWriter(new FileWriter(file))) {
br.write("################################");
br.newLine();
br.write(" Booking Information");
br.newLine();
br.newLine();;
br.write("First Name: " + TxtName.getText());
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}

Nothing is getting wrote to the file though. Does that code seem right?

View Replies View Related

User Input All Of Data On A Single Line And Implement StringTokenizer To Assign That Data To File

Mar 21, 2015

By using FileReader, FileWriter and their constituents, I am creating a file to contain employee information ( name, age, hours, etc. ). The user is to input all of the data on a single line and we were asked to implement StringTokenizer to assign that data to the file. I have never used the StringTokenizer before, but I have a rough idea how it is to function. I used pw.println to test what I have so far, now I would like to let the user build the initial file with the "first employees" of the company, and then view the file, and then go back and append new employee data to that same file. My question is, how can I take the user input as a StringTokenizer and add that to the file?

In the for loop below, I thought I would see if it would work, but it does not. The loop only executes once and does not allow me to enter data.

public class Records {
public static void main(String [] args) throws IOException {
Scanner input = new Scanner(System.in);
FileWriter fw = new FileWriter("dbs3.java");
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter pw = new PrintWriter(bw);
System.out.println("NEW EMPLOYEE DATA SHEET");
System.out.print("Number of new employees: ");
int number = input.nextInt();

[Code] ....

View Replies View Related

Count Single Digits

Apr 25, 2014

why exactly this isn't printing out the correct way.I'm supposed to print out 100 elements from an array but assign them random integers between 0 and 9.I've tried troubleshooting the issue and when I do it seems i'm only getting one element assigned.

public class Exercise_6_7{
public static void main(String[] args){
int[] counts = new int[100];
for(int i=0; i<counts.length; i++){
counts[i] = (int)(Math.random()*10);

[code]....

View Replies View Related

2D Array In NetBeans GUI

Aug 9, 2014

I am trying to create a program in NetBeans GUI builder and I am having trouble creating the 2D array. Here is what I have come up with so far:

private void enterButtonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
double time = 0;
try{
time = Double.parseDouble(timeText.getText());

[Code] ....

Right now it is printing what i need but I need to separate columns, not rows.

View Replies View Related

End Is Not Working In Netbeans

Jun 2, 2014

Currently the while near the end is not working in netbeans. It is saying illegal start of type. This whole section was working before when it was within the public static void method. I moved it to a separate class to try and clear up a, static variable problem. My question is can i fix it to keep it structured this way. Or do I have to put it back into the main method and try to work out the static variable problem a different way.

public class InventoryProgram {
double[] dvdprice; // defines variables
int[] dvdnum;
int[] dvdstock;
String[] dvdnames;
int count;
double total;

[code]....

View Replies View Related

Pause / Unpause With Single Key Input

May 27, 2014

I am coding a game and I am trying to implement a pause and unpause button. in the BoardPanel class I've added the button's 'p' and 'o' to game.wait() and game.notify() (main code is in game class). however the game.wait is having issues and even if i throw interrupted exception or try/catch it doesn't work. I'd like to code it to a single button if at all possible.

View Replies View Related

Multiplying Two Single Arrays (Corresponding Iteration)

Dec 14, 2014

Is there a way to multiply two single arrays in which the corresponding iteration from one array multiplies with the corresponding iteration from the second array. For example say you have array1[] and array2[]. Each array has a length of 5. Is there a way to multiply array1[0] by array2[0] and array1[1] by array2[1] and so on.... without having to actually write out the equation of array1[0] + array2[0] = someValue for all iterations of the two arrays?

View Replies View Related

Quick Single Linked List

Feb 11, 2015

i'm currently going over single linked list, and i'm coming across an error which i do not know how to get by. I'm using single linked list for now just for study purposes, then i would move on to double.

Error: No enclosing instance of type LList is accessible. Must qualify the allocation with an enclosing instance of type LList (e.g. x.new A() where x is an instance of LList).

public class LList {
private static class Node<E>{
private E data;
private Node<E> next;

[code]....

View Replies View Related

Single Linked List Boolean

Feb 13, 2015

i'm currently studying over single linkedLists and i'm just writing various methods for it. One method i'm currently stuck on is writing a remove method where it returns a boolean true if its found and it will delete it, and false if the target isn't found. My problem is that it always comes up as flase and i know that the target is in the linked list. Here is the code for my method.

Java Code: public boolean remove(E item){
Node<E> ptr = head;
while(ptr!= null && !item.equals(item))
ptr = ptr.next;
if(ptr.data.equals(item)){
ptr.next = ptr.next.next;

[code]...

View Replies View Related

Multiple Frames In Single Frame

Apr 3, 2014

i want to know how i can add more than one frame in a single frame means main window or frame will be constant and only components will be chang or vary as in a software or game .

View Replies View Related

Multiple Runnable In A Single Class

Aug 1, 2014

I want to have two threads running in my class, one will be downloading info from a website then putting the thread to sleep for a little bit, then repeating. The other will be sending information to a website then putting the thread to sleep for a little bit, then repeating. Is it possible to do this in my main class? I already have one thread using run() for downloading the info and sleeping can i make another?

View Replies View Related

Environment Independent Single WAR Generation

Oct 8, 2014

I have a project which has a set of configuration files, where each configuration file represents an environment specific configurations. In other words, I have 3 environments, development, staging, and production. The configuration for each environment is different, e.g. DB name, url etc.

Whenever I want to deploy the same code, on each environment, I have to manually generate environment specific .war file, so that it has environment specific configuration file in it.

What I am looking for is a kind of solution where i have to compile only once in maven and it generates only one .war file, which I can use on every environment. In other words, i want the environment specifi application server/tomcat to identify which configuration to pick.

That way, I'll be sure that we are deploying and testing the same .war file on every environment/application server.

How can i restructure the application to achieve this functionality?

View Replies View Related

JSF :: How To Render More Than One JSP Pages Into 1 Single View

May 15, 2014

I have an application where the WebContent folder has a number of .jsp pages like navigation.jsp, primarytabs.jsp etc.

The navigation.jsp contains a vertical menu and the primarytabs.jsp contains a tab on top, and some other jsps contain individual components.

When I run the application of the application server, it opens up a welcome page, and all these navigation items, and tabs and others merge into a single view and show us a well formed combination of all these components.

I did some studying and read about "composite views". But I wasn't sure if I can call this composite view or not.

How JSF combines all these jsps into one view and where to find that "binding" within the code so I can make the relevant changes?

View Replies View Related

JSP :: Using Multiple Queries In Single Page

Jun 6, 2010

This is my code-

<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<body>
<center>
<form>
<table border="0">
<tr> <td> bulbtype </td>
<td> <input type="text" name="bulbtype"></td> </tr>

[Code] ....

Im getting this error:

An error occurred at line: 24 in the jsp file: /bulb1.jsp
bulbwatts cannot be resolved
21: Statement stmt=conn.createStatement();
22: Statement st=conn.createStatement();
23: ResultSet rs1 = stmt.executeQuery("select * from bulb where type="+bulbtype);
24: ResultSet rs2 = st.executeQuery("select * from bulb where watts="+bulbwatts);
25: %>
26: <%while(rs1.next()){%>
27: <tr> <td>name1</td>

View Replies View Related

Error In Single Linked List

Sep 13, 2014

package progProject5;
// Implementation of single linked list.
public class SingleLinkedList<E> {
private Node<E> head = null;
private int size = 0;
// Methods

[Code] ......

I am in learning process and I know its very basic question but I got stucked at addAfter() where I need to insert the node after the given node.

View Replies View Related

Other Classes Not Recognised By NetBeans GUI

Jan 21, 2014

I'm working on a University project creating a simple game using Netbeans but I'm totally stuck. I've created a number of classes to perform various methods, such as throwing back formatted text but I can't get them to work from within a Swing GUI created in Netbeans.

The Main method simply creates an instance of another class called Game which then itself creates instances of a number of other classes (textEngine, timer) and also a Swing GUI Class. The GUI appears on screen ok and I've been able to get methods working inside the GUI such as changing pictures and text when clicking a button. But I CANT get the GUI class to recognise the instances of the other classes or access their methods. I've created an instance of the TextEngine class called tEng. So I type this code in the GUI class:

textField.setText(tEng.getPhrase(2));

getPhrase() returns a String based on the number passed in the argument. But Netbeans reports an error that tEng is not recognised as a symbol despit it being a member of the same package. Creating the instance of the class within the GUI class likewise fails:

TextEngine tEng = new TextEngine();

Again the class is not recognised.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved