Search Results

Search found 9 results on 1 pages for 'overtone'.

Page 1/1 | 1 

  • Directx and Open Libraries list? [closed]

    - by OVERTONE
    I've just been looking for comparissons between open and proprietary frameworks and libraries. More so just to get an idea of what exists than how they compare. For example: We have DirectX (graphics) and its open counterpart OpenGL DirectX (sound) and OpenAL But there are other DirectX libraries that I can't find open alternatives to such as DirectInput DXGI Direct2D DirectWrite Doe's anyone have any list's or Comparisons between Directx and their open counterparts?

    Read the article

  • Passing array into constructor to use on JList

    - by OVERTONE
    I know the title sound confusing and thats because it is. its a bit long so try too stay with me. this is the layout i have my code designed variables constructor methods. im trying too fill a Jlist full on names. i want too get those names using a method. so here goes. in my variables i have my JList. its called contactNames; i also have an array which stores 5 strings which are the contacts names; heres the code for that anyway String contact1; String contact2; String contact3; String contact4; String contact5; String[] contactListNames; JList contactList; simple enough. then in my constructor i have the Jlist defined to fill itself with the contents of the array fillContactList(); JList contactList = new JList(contactListNames); that method fillContactList() is coming up shortly. notice i dont have the array defined in the constructor. so heres my first question. can i do that? define the array to contain something in te constructor rather than filling it fromt the array. now heres where stuff gets balls up. ive created three different methods all of which havent worked. basically im trying to fill the array with all of them. this is the simplest one. it doesnt set the Jlist, it doesnt do anything compilicated. all it trys too do is fill the array one bit at a time public void fillContactList() { for(int i = 0;i<3;i++) { try { String contact; System.out.println(" please fill the list at index "+ i); Scanner in = new Scanner(System.in); contact = in.next(); contactListNames[i] = contact; in.nextLine(); } catch(Exception e) { e.printStackTrace(); } } } unfortunately this doesnt qwork. i get the print out to fill it at index 0; i input something and i get a nice big stack trace starting at contactListNames[i] = contact; so my two questions in short are how i define an array in a constructor. and why cant i fill the array from that method. ************************888 **************************888 stack trace by request please fill the list at index 0 overtone java.lang.NullPointerException please fill the list at index 1 at project.AdminMessages.fillContactList(AdminMessages.java:408) at project.AdminMessages.<init>(AdminMessages.java:88) at project.AdminUser.createAdminMessages(AdminUser.java:32) at project.AdminUser.<init>(AdminUser.java:18) at project.AdminUser.main(AdminUser.java:47) it was a null poiinter exception

    Read the article

  • making check boxes clickable once in javascript?

    - by OVERTONE
    Sorry but im an absolute noob with javascript. Ive made a form for a simple quiz but cant figure out how to make radio's only click once. I can select two or three buttons as my answer. i want to change this. <form name = "Beginners Quiz"> <p>Film speed refers to:</p> <p><input type="radio" name="Answer 1" id="Answer1" value = "a" onclick = "recordAnswer(1,this.value"/>How long it takes to develop film. <br/> <p><input type="radio" name="Answer 2" id="Answer2" value = "b" onclick = "recordAnswer(1,this.value"/>How fast film moves through film-transport system. <br/> <p><input type="radio" name="Answer 3" id="Answer3" value = "c" onclick = "recordAnswer(1,this.value"/> How sensitive the film is to light. <br/> <p><input type="radio" name="Answer 4" id="Answer4" value = "d" onclick = "recordAnswer(1,this.value"/> None of these makes sense. <br/> ive been rooting around w3shcools tutorials to no avail. can someone shed some light?

    Read the article

  • Array not showing in Jlist but filled in console

    - by OVERTONE
    Hey there. been a busy debugger today. ill give ths short version. ive made an array list that takes names from a database. then i put the contents of the arraylist into an array of strings. now i want too display the arrays contents in a JList. the weird thing is it was working earlier. and ive two methods. ones just a little practice too make sure i was adding to the Jlist correctly. so heres the key codes. this is the layout of my code. variables constructor methods in my variables i have these 3 defined String[] contactListNames = new String[5]; ArrayList<String> rowNames = new ArrayList<String>(); JList contactList = new JList(contactListNames); simple enough. in my constructor i have them again. contactListNames = new String[5]; contactList = new JList(contactListNames); //i dont have the array list defined though. printSqlDetails(); // the prinSqldetails was too make sure that the connectionw as alright. and its working fine. fillContactList(); // this is the one thats causing me grief. its where all the work happens. // fillContactListTest(); // this was the tester that makes sure its adding to the list alright. heres the code for fillContactListTest() public void fillContactListTest() { for(int i = 0;i<3;i++) { try { String contact; System.out.println(" please fill the list at index "+ i); Scanner in = new Scanner(System.in); contact = in.next(); contactListNames[i] = contact; in.nextLine(); } catch(Exception e) { e.printStackTrace(); } } } heres the main one thats supposed too work. public void fillContactList() { int i =0; createConnection(); ArrayList<String> rowNames = new ArrayList<String>(); try { Statement stmt = conn.createStatement(); ResultSet namesList = stmt.executeQuery("SELECT name FROM Users"); try { while (namesList.next()) { rowNames.add(namesList.getString(1)); contactListNames =(String[])rowNames.toArray(new String[rowNames.size()]); // this used to print out contents of array list // System.out.println("" + rowNames); while(i<contactListNames.length) { System.out.println(" " + contactListNames[i]); i++; } } } catch(SQLException q) { q.printStackTrace(); } conn.commit(); stmt.close(); conn.close(); } catch(SQLException e) { e.printStackTrace(); } } i really need help here. im at my wits end. i just cant see why the first method would add to the JList no problem. but the second one wont. both the contactListNames array and array list can print fine and have the names in them. but i must be transfering them too the jlist wrong. please help p.s im aware this is long. but trust me its the short version.

    Read the article

  • how to change color of text following function in javascript

    - by OVERTONE
    Ok before i make spaghetti of this code i thought id ask around here. ive made a quiz for an online site. The answers are stored in an array, and ive a function that checks the answers array to what youve clicked. then it counts them and gives you your score. but i want to change the clor of the right answer wen the user clicks the score button. so the correct answers are highlighted. something like this https://www.shutterpoint.com/Home-Quiz.cfm (just hit submit at the bottom, no need to do the quiz). the little answer icon at the side looks flashy but id rather just have the text change color. heres how my questions are formatted <p>Depth of field is controlled by :?</p> <p id = "question2"><input type="radio" name="question2" id="Answer1" value = "a" onClick ="recordAnswer(2,this.value)"/> The focal length of the lens. <br/> <input type="radio" name="question2" id="Answer2" value = "b" onClick = "recordAnswer(2,this.value)"/> The size of the aperture opening. <br/> <input type="radio" name="question2" id="Answer3" value = "c" onClick = "recordAnswer(2,this.value)"/> The distance between the camera and lens. <br/> <input type="radio" name="question2" id="Answer4" value = "d" onClick = "recordAnswer(2,this.value)"/> All of these. <br/></p> and these are the two functions that are called throughout. record answer is called every time the user clicks a button function recordAnswer(question,answer) { answers[question-1] = answer; } this is the final button which calculates the score function scoreQuiz() { var totalCorrect = 0; for(var count = 0; count<correctAnswers.length;count++) { if(answers[count]== correctAnswers[count]) totalCorrect++; } <!-- alert("You scored " + totalCorrect + " out of 12 correct!"); --> } another function is best i think. ive already made attemots at it and know i have to set the color using document.getElementById('question2').style.color = '#0000ff'; question2 being the p id i think if i take in the value part of (input type....) ill be able to compare it to the answers array. but im not quite sure how to do this. any helpers? maybe something like this document.getElementById("Answer1").style.color = '#0000ff'; using the id part of the (input type line) i think i got it actually. ill post my answer in a sec

    Read the article

  • correct way of initializing variables

    - by OVERTONE
    ok this is just a shot in the dark but it may be the cause of most of the errors ive gotten. when your initializing something. lets say a smal swing program. would it go liek this variables here { private Jlist contactList; String [] contactArray; ArrayList <String> contactArrayList; ResultSet namesList constructor here public whatever() { GridLayout aGrid = new GridLayout(2,2,10,10); contact1 = new String(); contact2 = new String(); contact3 = new String(); contactArrayList = new ArrayList<String>(); // is something supposed too go in the () of this JList? contactList = new JList(); contactArray = new String[5]; from1 =new JLabel ("From: " + contactArray[1]); gridlayout.add(components)// theres too many components to write onto SO. } // methods here public void fillContactsGui() { createConnection(); ArrayList<String> contactsArrayList = new ArrayList<String>(); while (namesList.next()) { contactArrayList.add(namesList.getString(1)); ContactArray[1] = namesList[1]; } } i know this is probably a huge beginner question but this is the code ive gotten used too. im initializing thigns three and fours times without meaning too because im not sure where they gp. can anyone shed some light on this? p.s. sorry for the messy sample code. i done my best.

    Read the article

  • setting something disposed or invisible java

    - by OVERTONE
    this might be simple enough as just inserting the right method but i cant seem to get it right. i have a simple program with two buttons. each one changes the picture above them. but anytime i click the buttons i get some odd awt event queue error. i think its because im trying to add something to a frame after its already been made. package icnon; import javax.imageio.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class FrameIconExample extends JFrame implements ActionListener { JLabel j; JPanel p, l, k; JButton picOne, picTwo; Container cPane; public FrameIconExample() { JButton picOne = new JButton("picOne"); JButton picTwo = new JButton("picTwo"); picOne.setName("picOne"); picTwo.setName("picTwo"); picOne.addActionListener(this); picTwo.addActionListener(this); JPanel p = new JPanel(new GridLayout(2, 1)); JPanel l = new JPanel(new FlowLayout()); JPanel k = new JPanel(new FlowLayout()); cPane = getContentPane(); j = new JLabel(new ImageIcon("../meet/src/images/beautiful-closeup-portrait-photography.jpg")); l.add(j); k.add(picOne); k.add(picTwo); p.add(l); p.add(k); add(p); } public static void main(String[] args) { FrameIconExample frame = new FrameIconExample(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(new Dimension(300, 800)); frame.setTitle("Frame Icon Example"); // Display the form frame.setVisible(true); } @Override public void actionPerformed(ActionEvent e) { JButton temp = (JButton) e.getSource(); String src = "../meet/src/images/Majken Kruse portrait - john.jpg"; //System.out.println(src + " " + temp.getName()); if(temp.getName().equalsIgnoreCase("picOne")) { src = "../meet/src/images/beautiful-closeup-portrait-photography.jpg"; System.out.println(src + " " + temp.getName()); Icon img; j = new JLabel(new ImageIcon(src)); l.add(j); System.out.println("1"); } if(temp.getName().equalsIgnoreCase("picTwo")) { src = "../icontest/images/Majken Kruse portrait - john.jpg"; System.out.println(src + " " + temp.getName()); Icon img; j = new JLabel(new ImageIcon(src)); l.add(j); System.out.println("2"); } } } its all just the one program so if you copy paste it into an editor you can see the stack trace. but the source of the image files wont be there. does anyone know how id do it? or where im goin wrong? stack trace: ../meet/src/images/beautiful-closeup-portrait-photography.jpg picOne Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at icnon.FrameIconExample.actionPerformed(FrameIconExample.java:68) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

    Read the article

  • Storing Result set into an array

    - by OVERTONE
    i know this should be simpel and im probably staring straight at the problem but once again im stuck and need the help of the code gurus. im trying too take one row from a column in jdbc, and put them in an array. i do this as follows: public void fillContactList() { createConnection(); try { Statement stmt = conn.createStatement(); ResultSet namesList = stmt.executeQuery("SELECT name FROM Users"); try { while (namesList.next()) { contactListNames[1] = namesList.getString(1); System.out.println("" + contactListNames[1]); } } catch(SQLException q) { } conn.commit(); stmt.close(); conn.close(); } catch(SQLException e) { } creatConnection is an already defined method that does what it obviously does. i creat my result set while theres another one, i store the string of that column into an array. then print it out for good measure. too make sure its there. the problem is that its storing the entire column into contactListNames[1] i wanted to make it store column1 row 1 into [1] then column 1 row 2 into [2] i know i could do this with a loop. but i dont know too take only one row at a time from a single column. any ideas? p.s ive read the api, i jsut cant see anything that fits.

    Read the article

  • how do you find the exact variable of a null pointer exception

    - by OVERTONE
    I've been at this one for a bit now. I've got a null pointer exception so im guessing somethings not been initialized. AdminMessages.inbox1.setText(messageRsetArray[0]); thats my code where its targetting. but i cant find what inside it hasnt been initiazed. AdminMessages is a class which contains a JTextField called inbox1, messageRsetArray is an array which has taken variables from an array. also inbox1 is static. i coulndt get the getters and setter to work. i know its bad practice though.

    Read the article

1