Building A Document Based On A Series Of Check Box Selections?
Jan 17, 2014
I'm trying to build a program that would present the user (well...me) with a rather large list of various check boxes (and combo boxes, etc...but for sake of the question I'll limit it to check boxes) and the selections would not only need to be stored in some way so they could be reloaded, but also they would need to have the "data" used to build sentences.
For example, part of the form would have a checkbox list like:
Emotional Issues -
Emotion 1, Emotion 2...Emotion 40
Then, at the end of the form I would be able to save client, load client, or generate report. When doing the generate it would output something like:
"Client's first name reported having emotional disturbance in areas of 'Emotion 1', 'Emotion 4', and 'Emotion 12'."
There, of course, would be probably several hundred check boxes, combo boxes, etc. throughout this program building a rather complex "report" when it's all said and done. So where I am stumped in on the methodology or approach that would be best for getting, storing, retrieving, and outputting this information.
View Replies
ADVERTISEMENT
Dec 18, 2014
i'm totally new to Java.I'm making a small text based RPG and this is what i've come up for now.
Java Code:
import java.util.Scanner;
class Main {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
Player playerObject = new Player();
[code]....
My thing is that i want the user to enter 'Caucasian' or another race in the console below and i want it to be saved in a variable or something else in the Player Class that i can later use it in texts or something else. My question is how can i do it?
I tried like 'int Mongoloid = 1; int Caucasian = 2;'
And the same with the others, and after that i tried to use them with the Switch Statement but it did not work.
View Replies
View Related
Jun 17, 2014
The goal of this software is to provide a web interface which must be able to manage the Quagga routing daemon. For those who don't know Quagga, the only interface it provides the user is its built-in cli. My project must convert web events to commands and vice-versa. how I'm going to maintain quagga's configuration state synchronized with JSF's managed beans. The example below shows the commands one must run on quagga's cli in order to add a BGP neighbor:
neighbor 10.0.0.1 remote-as 65535
neighbor 10.0.0.1 description "Just a Test"
neighbor 10.0.0.1 next-hop-self
neighbor 10.0.0.1 soft-reconfiguration inbound
write memory
In order to represent this piece of information in my project, I was thinking about mapping this to a class:
public class BGPNeighbor {
private String ip_address;
private Integer asn;
private Boolean next_hop_self;
private Boolean inbound_soft_reconfiguration;
}
With this I would parse the information from Quagga's configuration and map this to classes in my software. I think it's a lot easier to do with database-based software, the problem with this project is that it's not completely database oriented. The information must be fetched from the network, parsed, converted to classes and then they would be available to JSF as managed beans. Any alteration to this classes must be converted to quagga cli commands which must be executed through the network again (telnet).
View Replies
View Related
Jan 21, 2015
How to add select case
when to_char(trunc(TO_DATE ('03-APR-2015','DD-MM-YYYY'), 'mm'), 'FMDAY') = 'SUNDAY'
then to_number(to_char(TO_DATE ('03-APR-2015','DD-MM-YYYY'), 'W'))+1
else ceil((to_char(TO_DATE ('03-APR-2015','DD-MM-YYYY'), 'dd') + 1 - to_char(next_day(trunc(TO_DATE ('03-APR-2015','DD-MM-YYYY'), 'mm'), 'SUNDAY'), 'dd'))/7)+1
end week_no
from dual
query to Eclipse Link CriteriaBuilder
I am able to add distinct(to_char(sum(datecolumn,number),'W-MM-YYYY')) like
Expression sum = cb.sum(CriteriaQueryUtils.getPath(rt, breakupFields), cb.literal(miliSecToAdd));
Expression<String> literal = cb.literal("W-MM-YYYY");
Expression<String> functionselectclause = cb.function("TO_CHAR", String.class, sum,literal);
return query.select(functionselectclause ).distinct(true).where(p).orderBy(orders);
But need to know how to add case when else to CriteriaBuilder...
View Replies
View Related
Apr 15, 2014
I am trying to make a pyramid from blocks . I know that for example to make a bigger block from small blocks you write something like :
for(int i = 10 ;i <=1 ; i--){
for (int j= 10 ;j <= 1 ; j--) {
< statement to create block where you use both i and j to define the location of each block>
}
}
but i cant seem go grasp how to make a pyramid , so far my best effort is :
int i =10 ;
while (i >=1 ) {
for( ; i>=1 ; i-- ){
< statement to create block > }
}
At the moment visually i don't get a pyramid but it might be because of other issues and not because of the while and then a for inside it approach .
My approach is correct and if now what would be the correct one to create a pyramid from smaller blocks ?
View Replies
View Related
Jan 18, 2015
I'm assigned along with two others to make this program for a project.
We need to store data to the program by adding them such as user_id among the 5 criterias that are needed. Lets say I want a new user, I need the program to give me that option and then I would type in the user id and the program would store that data information
As far as I'm aware, boolean, screentokenizer and scanner is involved in the making of this program.
View Replies
View Related
May 28, 2014
I have to write a program for class that basically uses Paint Component to draw a bunch of rectangles to look like a building then have them change color randomly. I am stuck I can't figure out how to make it draw the rectangles in rows and columns to look like the building i can make it display multiple squares randomly however but thats not the assignment.. here is my code
package labBuilding;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
@SuppressWarnings("serial")
public class Building extends JPanel {
[code]....
View Replies
View Related
Mar 30, 2014
I'm having this where i'm trying to return a JPanel with tempPictures but only if they aren't already filled with "actual" pictures. However this causes problems because your never shore that the if statement will execute. I tried adding an else statement but i cant return null i must return a JPanel;
private JPanel buildTopShelf() {
if(myMediaHandler.mediaList.size() < 6) {
JPanel mediaPanel = new JPanel();
mediaPanel.setOpaque(false);
mediaPanel.setLayout(new GridLayout(1,6,22,0));
mediaPanel.setBounds(90, 14, 1020, 210);
[Code] ....
View Replies
View Related
May 21, 2014
My multi threaded application processes and loads records into an ECM repository. For reconcliation purposes , I am trying to build an XML format report with the results of the processing per record, while processing is underway per thread. The method below is called from every thread wvery time its ready to append an element to the DOM with the status.
public void writeReportLine(Element rptLine) {
// Write output to report file
synchronized (XMLReportHandler.class) {
reportOutput.getDocumentElement().appendChild(rptLine);
}
}
After all processing completes, the below method is called only once by every thread to write to the File on the file system:
public void writeToReportFile() {
synchronized (XMLReportHandler.class) {
try{
//write the content into xml file
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
DOMSource source = new DOMSource(reportOutput);
[Code] ....
The problem is that when under load, the threads just seem to hang while the transformer.transform(source, result) call keeps getting executed until there is an interrupt of some sort. I was able to examine a section of what was appended and it was status for records that had finished processing very early in the process based on my application logs. Once an interrupt is recieved , it looks like the threads recover.
View Replies
View Related
Nov 23, 2014
building a game. the game is all about the multiple times table with levels. easy medium and difficulty. I dont even know where to begin and what is the codes to use or even the platform. what websites can be access etc and what is the big deal with code tags.
View Replies
View Related
Jul 13, 2014
I'm trying to build a binary tree using two arrays I'm given, one is inorder and the other is postorder and I have to construct the tree based on that. I understand the strategy I need to use- the last element of the postorder array tells me the root node, and wherever the value of that node occurs in the inorder array is where the tree is split. I can then apply this idea recursively to build the tree. For whatever reason though, I keep getting stack overflows.
Here's what I have so far:
public static class TreeNode {
char val;
TreeNode left;
TreeNode right;
TreeNode(char newVal) {
val = newVal;
[Code] .....
View Replies
View Related
Apr 4, 2014
Every year, she has to plan when her employee's can go on vacation for the summer holidays - MANUALLY. It takes weeks to solve the puzzle, because she has several kinds of employee's hired, with different skills. And at all days there must be X amount of employees with skill1 at work, plus Y amount of employees with skill2 etc, and they also need special "off-days" in comparison to when they last worked and so on. It's quite the math puzzle.
I've worked a little with C#, and built a prototype of a Support System (Ticket based), so I got the basics down of programming, and I know Java and C# are quite alike, so I don't think making the switch will bother me that much.
The program should be easy to use for her, so it needs a visual calender that can be interacted with, and it should also be easy to see which employee is at work at that date and so on.
Will it be hard for me to build this kind of Calender, that allows the interaction I want?
Any open-sourced projects, or libraries that will make my task easier?
I plan on using NetBeans IDE for this project.
View Replies
View Related
Nov 17, 2014
Implement an applet that display historical facts. The applet will include facts from october 28 to december 4th to test the applet.
What is the best thing to add text in my GUI - JLabel, JTextArea? I am trying to display different words on my csFacts. Once a user click button yesterday and button tomorrow?
public class Facts extends JFrame implements ActionListener{
private JButton button1,button2;
private JPanel panel;
private JLabel label;
TextField ri = new TextField(50);
private void createGUI(){
setDefaultCloseOperation(EXIT_ON_CLOSE);
[Code] .....
View Replies
View Related
Nov 20, 2014
My assignment was to create a simple form that demonstrates the use of the factory and singleton design patterns. "Use the Factory pattern to ensure that each form input consists of a text label and a textfield. Use the Singleton pattern for the submit button."
Here's what I have:
Form.java file
interface Form {
public void getFormField ();
}
Name.java file (I have a similar files just like this for Address.java, City.java, State.java, Zip.java and Phone.java)
import java.util.Scanner;
class Name implements Form
[Code] ....
It compiles at the moment but I get a null pointer exception in the main method of the FormFactoryDemo file.
View Replies
View Related
Jun 20, 2014
I have given a series like this..
10+13+16+19+....+50;
Now I've to find the summation for this. I did it like following bt its not correct..
public static void main(String[] args){
int i=0,k=10, sum=0;
k=k+2;
for(i=10;i<=50;i++){
sum=sum+k;
}
System.out.println(" "+sum);
}
View Replies
View Related
Nov 1, 2014
how to find the sum of the following series
f(x)= 1+3+5+.......+2n+1
this what I did
Java Code: for ( n=0;x>0 && x<2*n+1;n++)
{
sum=sum+2*n+1;
n++;
System.out.println(sum); mh_sh_highlight_all('java');
Is it infinite loop?
is this correct ?
View Replies
View Related
Jun 8, 2014
My project is writing a program that generates a series of numbers to appear like a social security number (XXX-XX-XXXX). My code runs.. But any number below 10 it just shows one number (XXX-X-XXXX). What do I need to enter in to my code so that if the number is <10 it will show (00,01,02,03....)?
Java Code:
import java.util.Random;
public class IDnumber
{
public static void main (String[] args) {
Random generator = new Random()
int num1 = (generator.nextInt(7) + 1) * 100 + (generator.nextInt(8) * 10) + generator.nextInt(8);
int num2 = generator.nextInt(74);
int num3 = generator.nextInt(10000);
String IDnumber = num1 + "-" + num2 + "-" + num3;
System.out.println(IDnumber);
}
} mh_sh_highlight_all('java');
View Replies
View Related
Jun 18, 2014
Write a program called ComputePi to compute the value of pi using the following series expansion. you have to decide on the termination criterion used in the computation(such as number of terms used or the magnitude of an additional term). Is this series suitable for compute pi?
PI=4*(1-(1/3)+(1/5)-(1/7)+(1/9)-(1/11)+(1/13)-(1/15)+.......)
View Replies
View Related
Jun 11, 2014
How to print 10 numbers in Fibonacci serious aftet given number?
Like 13 21 34...
View Replies
View Related
Oct 27, 2014
write a java program to check divisibility of a series of numbers that a user inputs the starting and ending numbers and also the number to check divisibility with.
The problem I am having is it only checks the first number and doesn't check the rest.
import java.util.Scanner;
public class MyMidTermAssignment
{
public static void main(String[] args) {
int numberInputBeginning,numberInputEnding,divisibleByNumber;
System.out.println("Enter first number of series");
[code]....
View Replies
View Related
Feb 8, 2014
Program to generate Fibonacci series program using java multithreading.
View Replies
View Related
Dec 31, 2014
My code:
public class Fibonacci {
/**
* @param args
*/
public static void main(String[] args) {
int f[]=new int[100];
for(int j=0; j<100;j++){
f[j]=j;
[Code] ....
How can I improve my code?
View Replies
View Related
Sep 5, 2014
I am having trouble compiling my code for a java application that is supposed to print out the infinite series for Pi. Here is my java code:
//a java application that generates the infinite series for Pi, ie 3.14159...=4-4/3+4/5-4/7+4/9
public class Pi{
public static void main(String args[]){
//declare and initialize variables
long counter=1;
double pi;
[Code] ....
Here is the error in my output that results when I attempt to compile my code:
C:UsersanonymousDesktopchapter five exercises for javaPi.java:21: error: variable pi might not have been initialized
total=total+pi;
^
1 error
Tool completed with exit code 1
Why do I need to initialized pi when I already initialized the total?
View Replies
View Related
Nov 10, 2014
So basically, I've been trying to create a for loop that asks the user for a number between 1 and 30, then calculates the total of the series of numbers. For example, if 15 is entered, the calculation should be 1/15+2/14+3/13+...15/1 which would equal approximately 38.1. The problem I'm having is that the code doesn't loop whenever I type a number for some reason, which results in a very incorrect calculation. Here is my code so far:
import java.util.Scanner;
public class HmwLoop {
public static void main(String[] args) {
double sum = 0;
for (double num1 = 1, num2 = 30; num1 <= 30 && num2 >= 1; num1++, num2--)
[Code] .....
View Replies
View Related
Jun 12, 2014
I wrote java program to print fibonacci series till user wants it! But I'm getting this compilation error -
fibo.java:Incompatible types
found:java,lang.String
required:int
n=s.readline();
import java.awt.*;
import java.io.*;
import java.util.*;
class fibo {
public static void main(String args[])throws IOException {
int arr[]=new int[100];
[Code] ......
View Replies
View Related
May 9, 2014
write a program to determine the sum of the following harmonic series for a given value of n:1+1/2+1/3+.............................+1/n the value of n should be given interactively through the keyboard.
View Replies
View Related