JFrame - Gathering Info From Net?
Nov 7, 2014
I'd like to know how to,
1. Connect to Google,
2. Search for something,
3. Return a SCREEN SHOT of the results.
I'm assuming this involves loading the webpage into a JFrame, or is there an easy workaround?
View Replies
ADVERTISEMENT
Feb 11, 2014
I want to get info from one class to another LIKE ALL information.
View Replies
View Related
Apr 22, 2015
I am reading from a database(SQL Server 2012) and storing that information in a ResultSet. I am then trying to display that information using a DataTable.
Here is my managed bean
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package clientspage;
import java.io.Serializable;
[Code].....
The ID and the commandLinks are being displayed but the Client is not.
View Replies
View Related
May 10, 2014
I was wondering where can I find info on how to grab info from websites to use in a program?
View Replies
View Related
Jun 21, 2014
I want to enter the triangle data in the method and every time I try to compile the program I get the error message--cannot find symbol.
import java.io.*;
import java.util.*;
public class trianglemethod {
public static void main(String [] args) {
Scanner kbreader = new Scanner (System.in);
[Code] .....
View Replies
View Related
Apr 6, 2014
I want to ask that, when a server listen to A port and it accepts a request from a client then the server accepts the request using accept method,but how does the server get the info about the client like wat is the port no and ip address of the client,I read a answer regarding this that Server never gets the port no of client only the ip address and it connects to client using a connection stream but as far I know from networking, a device must have the ip address and port no of the device it wants to connect to.
View Replies
View Related
Oct 28, 2014
how should i write appropriate methods to get user info like age, email address etc?
View Replies
View Related
Feb 9, 2015
Suppose there're two classes: Exam and MainExam (contains a main method). class Exam has a constructor public Exam(String firstName, String lastName, int ID). Class MainExam reads data from a textfile. For example, the data can be: John Douglas 57. How can one pass data to the constructor from a textfile?
View Replies
View Related
May 13, 2015
Let's say I'd like to print out something as a prompt without end with a new line char, so the standard System.out.println() is not an option and I'd like to find something else inplace of println().
Where to find that? I googled about that and learned printf() is the one I want, but how to get it from java api documentation.
View Replies
View Related
Jun 22, 2014
So I have this line of code...
ioexception11.addChoosableFileFilter(new Jframe());
And when I compile it gives me...
error: constructor Jframe in class Jframe cannot be applied to given types;
ioexception11.addChoosableFileFilter(new Jframe());
View Replies
View Related
Jan 18, 2012
I was trying to make a UDP voice chat but i couldn't make the receive method work! so i just move on to work with TCP. I found a simple code that i found it pretty easy to understand,but i couldn't make it work, always stuck within exception.
Here is the output I got:
Available mixers:
Java Sound Audio Engine
Microsoft Sound Mapper
WinOS,waveOut,multi threaded
java.lang.IllegalArgumentException: Line unsupported: interface TargetDataLine supporting format PCM_SIGNED, 8000.0 Hz, 16 bit, mono, little-endian, audio data
And here is the code
sender:
Java Code:
package sender;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import javax.sound.sampled.AudioFormat;
[Code] ....
I tried to play with the index of mixerInfo array in the line
Java Code:
Mixer mixer = AudioSystem.getMixer(mixerInfo[1]); mh_sh_highlight_all('java');
But nothing happened. How I can fix that?
View Replies
View Related
Apr 28, 2014
I am trying to invoke some methods in a for loop in order to print some info stored in a List. But for some reason, compiler pops a message saying "cannot find symbol - method getEmpID(). You are using a symbol here (a name for a variable, method or class) that has not been declared in any visible scope." But I am pretty sure that method getEmpID (as also getName(), getAfm(), and payment() ) have been declared as public.
Note: My List contains objects of different type (SalariedEmployee, HourlyEmployee). I hope this is not the factor causing this problem.
Java Code:
import java.util.*;
abstract class Employee{
private String name = "";
private String afm = "";
private long EmpID;
static long count=0;
[code]....
View Replies
View Related
Apr 17, 2014
I've got a nasty nullpointer that I have tried to resolve to no avail as of yet. The program should prompt for a listings.txt file and take its info and write to a report file. Here's the stacktrace:
run:
Input file: listings
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.<init>(Writer.java:88)
at java.io.PrintWriter.<init>(PrintWriter.java:113)
at java.io.PrintWriter.<init>(PrintWriter.java:100)
at kettask2b.PropertyListingsReport.main(PropertyListingsReport.java:34)
Java Result: 1
Some adjustments that I have attempted are:
BufferedWriter pwfo = null;
for (int i = 0; i < args.length; i++) {
String string = args[i];
pwfo = null;
[Code] ....
Here's the code:
package kettask2b;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
[Code] ....
View Replies
View Related
Nov 19, 2014
I am trying to get this to where I can type in a name and it will search through each object and print back the corresponding object info.
Java Code:
import java.util.Scanner;
public class MyPeople {
public static void main(String[] args) {
Person[] p = new Person[] {
new Person("Chris", 26, "Male", "NJ", "Single"),
new Person("JoAnna", 23, "Female", "NJ", "Single"),
new Person("Dana", 24, "Female", "NJ", "Single"),
new Person("Dan", 25, "Male", "NJ", "Single"),
new Person("Mike", 31, "Male", "NJ", "Married") };
[code]....
View Replies
View Related
Apr 12, 2014
Basically the class is supposed to have a static variable that keeps track of the number of companies (numberOfCompanies) that have been created and a static method that returns the value of this variable. I need to have a constructor and a method to addEmployee, a method to printCompany, and a toString method. The addEmployee method will check that there is only 1 salesperson, 2 designers, and 4 manufacturing persons at a time and will check that there are no more than 7 employees of the company.
The addEmployee method will return a String indicating what the error is (i.e. "There is already a sales person in this company") or a null if the employee was added. If attempting to name a third company, an error message will be shown. what i have so far but my print company mmethod returns null company class :in which i am obliged to use inputdialog because it says that it cannot return void when i use the showmeassage diaolog.
company class:
import java.util.ArrayList;
import javax.swing.JOptionPane;
public class Company {
private ArrayList<Employees> list ;
private static int numberOfCompanies;
[Code] ....
error message when print button is clicked:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: JOptionPane: parentComponent does not have a valid parent
at javax.swing.JOptionPane.createInternalFrame(Unknown Source)
at javax.swing.JOptionPane.showInternalOptionDialog(Unknown Source)
at javax.swing.JOptionPane.showInternalMessageDialog(Unknown Source)
[Code] ......
View Replies
View Related
Jan 23, 2015
how we call a jFrame from another jFrame .
View Replies
View Related
Apr 24, 2014
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tables;
import java.util.Date;
import javax.swing.table.DefaultTableModel;
import javax.swing.JOptionPane;
import javax.swing.RowFilter;
import javax.swing.table.TableRowSorter;
[Code]...
Iam using J grasp or text wrangler for macbook
View Replies
View Related
Apr 5, 2015
I was wondering if its possible to show a video (mp4) inside a jframe? like the windows media player ....
View Replies
View Related
Apr 16, 2014
how to use JFrames and button and so on in Java. I found this video on youtube and followed it along, however even though my program is virtually identical to his, I'm still getting errors.
Here's the video I was watching: Video
And here's my code:
import javax.swing.*; //Imports JFrame and JButton for use
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.*;
import java.awt.*;
import java.awt.event.*;
public class swing
[code]....
The reason why I'm importing some many things is I'm trying everything to try fix my problem.
He's the error messages I'm getting:
frame2.add(panel);
^
C:UsersWindows 8Documentsswing.java:42: error: illegal start of expression
frame2.add(panel);
[code]....
I used to make the button just create another frame without additional labels but I changed it to be even more similar to his program just to rule everything out. Also initially my program varied quite a bit, I've changed everything to be like his. Even without the ";" error I got, I kept telling me I was not allowed have my class as static, even though the guy in the video has it set to static. Also I don't think my "setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);" is working as it doesn't change color.
I think the problem is with my panel, it isn't adding to the frame for some reason.I'm using TextPad7 and I'm using Win8.
C:UsersWindows 8Documentsswing.java:42: error: '(' or '[' expected
frame2.add(panel);
^
C:UsersWindows 8Documentsswing.java:42: error: illegal start of expression
frame2.add(panel);
[code]....
I would also like to point out that some of the comments are out of date and are referencing the way the program was before I made it just like his. For example I know my second class isn't inheriting the first class.
View Replies
View Related
Nov 10, 2014
how to build GUI's with JFrame and I was firstly very confused as to when and what is always needed for any GUI in Java. How do I know everything I need for a GUI? Are there certain things every GUI will need by default?
Additionally below I have a code snippet of when this person used the "this" as an argument to a JButton and Im just really confused for when I can use it and when I can't.
public UIStuff(){
super("Multiple Button Events");
init();
} // end multi-button
[code]....
View Replies
View Related
Feb 3, 2014
im working on a program, but i have question and its. How can i add a website into one of my "JFrame" i have made?
exampel i want to add google.com website into the fram called V2.
HERE IS MY CODE:
Java Code: package mittprogram;
import java.awt.Color;
import java.awt.Font;
[Code].....
View Replies
View Related
Apr 23, 2014
i am creating a desktop application. In this application, firstly there is a log in form. Now, i want to display the another form on the same window i.e by removing log in form a new form..
View Replies
View Related
Apr 14, 2014
why my image may not be showing. Note I am using eclipse.
Window.java:
import javax.swing.*;
public class Window {
private JFrame gameWindow;
public Window() {
gameWindow = new JFrame("Tamagotchi!");
[code]....
I have used file.exists() and this returns true, and file.length() which returns the correct file size.
System.out.println(backgroundImage) returns "splash.png" so thats ok.
Why then is my image not showing?
View Replies
View Related
Jan 30, 2014
So I've been getting back into Java and downloaded eclipse back onto my laptop. However when I go to make a simple rectangle into a JFrame, the frame will pop up but no rectangle will be shown. Here is my main class, which sets up the JFrame...
mport javax.swing.JFrame;
public class Frame{
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setTitle("I hope this fucking works");
frame.setSize(400,400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
[code]....
View Replies
View Related
Apr 13, 2014
Is there a way to simply slap a rectangle into a JPanel (make it appear) with out creating an inner Class or helper Method, all within "Main"? And if not, why?
Making a JFrame is easy.
Adding a JPanel is a snap.
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class TheJFrame {
public static void main(String[] args) {
// TODO Auto-generated method stub
[code]....
View Replies
View Related
Feb 3, 2014
I want to insert an image in a jframe...
View Replies
View Related