Simple Swing Question for HTML

I am trying to load a web page and I know how to do that using JEditorPane or JTextPane, but what I need to do is for the program to be able to load the page, enter a username and password in 2 of the <input> text fields and then submit it.
IMPORTANT: I don't mean that I or a user would login, I mean the program I write would auto login.
Does anyone know how this is accomplished?
I do know how to do it with Javascript, but this needs to be a Java application.
Once loaded I would then do some web scraping, again with Java, this I think I know how to do.
Thanks,
Dan

Hi!
Maybe you can find one part of the solution here (Reply 2,3,4)
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=285307
or here
http://forum.java.sun.com/thread.jspa?threadID=786631&messageID=4470190#4470190
This would be the part for getting the username and password.
How to submit it I do not know. I would look at class HttpURLConnection and the tutorial: http://java.sun.com/docs/books/tutorial/networking/urls/index.html

Similar Messages

  • Easy swing question for Java friends

    Hi could somebody test this short application and tell me why the "DRAW LINE" button doesnt draw a line as I expected?
    thank you very much!
    Circuitos.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import java.awt.geom.*;
    public class Circuitos extends JApplet {
         protected JButton btnRect;
         protected Terreno terreno;
         private boolean inAnApplet = true;
         //Hack to avoid ugly message about system event access check.
         public Circuitos() {
              this(true);
         public Circuitos(boolean inAnApplet) {
            this.inAnApplet = inAnApplet;
              if (inAnApplet) {
                   getRootPane().putClientProperty("defeatSystemEventQueueCheck",Boolean.TRUE);
         public void init() {
              setContentPane(makeContentPane());
         public Container makeContentPane() {
              btnRect = new JButton("DRAW LINE");
          btnRect.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                terreno.pintarTramo();
              terreno = new Terreno();
              JPanel panel = new JPanel();
              panel.setLayout(new BorderLayout());
              panel.add("North",btnRect);
              panel.add("Center",terreno);
              return panel;
         public static void main(String[] args) {
            JFrame frame = new JFrame("Dise�o de Circuitos");
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              Circuitos applet = new Circuitos(false);
              frame.setContentPane(applet.makeContentPane());
              frame.pack();
              frame.setVisible(true);
    }Terreno.java:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.geom.*;
    public class Terreno extends JPanel {
         Graphics2D g2;
         public Terreno() {
              setBackground(Color.red);
              setPreferredSize(new Dimension(500,500));
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
          g2 = (Graphics2D) g;
          g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);    
         public void pintarTramo () {     
              Point2D.Double start   = new Point2D.Double(250,250);
              Point2D.Double end     = new Point2D.Double(250,285);
              g2.draw(new Line2D.Double(start,end));            
    }

    I don't think the date I became a member has anything to do with it. Yes, I signed up a year ago to ask a question or two when I didn't know anything. It wasn't until recently have I started to use this forum again, only to try and help people as well as ask my questions. It took me a year to get to this point to where I can actually answer questions instead of just asking. So don't be silly and judge a person based on their profile.
    Secondly, I agree with you, the search utility is great. I use it all the time and usually I'll find my answers, but if I don't is it such a pain in the butt for you to see the same problem posted again?? I know how much you want people to use the resources available before wasting forum space with duplicate questions, but it's not going to happen. Some people are not as patient and you being a butt about it won't stop it.
    My point in general is that there are nice ways to help people and even rude ways, and your comments at times come across rude to me, even condescending. You have a lot of knowledge, therefore certain things seem trivial to you... but try to understand where some of the new people are coming from. The Swing tutorial is extremely helpful but if you don't understand the concept of programming or java that well... then it can be overwhelming and you don't know where to start. It's a huge tutorial and when people are stuck they just want an answer to their one question. Most figure it's easier to ask someone who already knows instead of reading an entire tutorial to get their answer.
    I've learned by both methods, by taking the time to research it myself and by asking a lot of questions. I have the time. Some don't. Please realize that not everyone is like you and they will continue to ask whether you like it or not. You have a choice, either help them or not.

  • Basic question for HTML DB

    Hi ,
    I am a very new user to HTML DB . i had requested for a workspace from htmldb page. I tried developing some basic pages . My application nuber is 920 .
    If I have to make the URL accessible to other users ..what do I need to do .
    Presently the URL is http://htmldb.oraclecorp.com/pls/htmldb/f?p=960:1:7293424715472730277
    how to have this in my machine ? Should I have HTML DB installed and apache installed in my machine ..
    Please clarify .
    Thanks,
    Madhu

    Hello,
    You need to change the authentication scheme to 'No Authentication (using DAD)
    '. You can set this up by creating a new authetication scheme in the
    Workspace xxx> Builder - Application xxx>Shared Components>Security>Authentication Schemes>Gallery
    Tab.
    Once you apply this new auth.. scheme. Then you and your users should be able to open URL directly to the 'http://htmldb.oraclecorp.com/pls/htmldb/f?p=960:1'
    To get HTMLDB on your machine you need the following:
    1. Oracle 9i or 10g RDMS software
    2. 10g RDMBS Companion CD
    3. Configure a Oracle database that has XDB schema.
    The 10g Companion CD contains the Oracle Apache and HTMLDB engine software. So you don't need separate Apache install.
    The Oracle DB, Oracle Apache and HTMLDB engine can all installed on one PC.
    If you are using 9i RDBMS , make sure you patch it up to 9.2.0.4 or higher (i think).
    Hope this helps.
    Regards,
    Philip

  • Simple swing question, probably

    Guys,
    New to Swing, new to Java:
    I realize I can disable buttons on an application with setEnabled(false). Is there a way to make them disappear altogether?
    I have a small desktop app that I would like to make user configurable in that certain buttons not useful to some clients can be disabled. I can grey them out, but it sure would look nice if I could make it where they're not painted at all...
    Anyone?
    TIA
    chewy...

    do setVisible(false)To be a little clearer, that'd be:
    button.setVisible(false);

  • Simple Swing Question

    can swing components (eg JLabel) be added to a Container (eg Panel)?

    Why not add it to a JPanel? It's not a good idea to mix awt and swing components together, you just risc weird behaviour.

  • Simple formatting question for mail-script

    I would like to edit the script below, so that theSubject ends up on a line of it's own,
    and messageURL indented on a new line below. It's important that it's indented.
    As it is now, the sixth line from the bottom counted; "make new entry with properties
    {name:theSubject & messageURL}" puts everything on the same line.
    tell application "Mail"
    try
    set theSelection to the selection
    repeat with theMessage in theSelection
    my importMessage(theMessage)
    end repeat
    end try
    end tell
    on importMessage(theMessage)
    tell application "Mail"
    try
    set theSubject to subject of theMessage
    set messageURL to "message://%3C" & (message id of theMessage) & "%3E"
    tell application "TaskPaper"
    tell front document
    make new entry with properties {name:theSubject & messageURL}
    end tell
    end tell
    end try
    end tell
    end importMessage
    Thanks in advance,
    Hakan
    Message was edited by: swedishstargazer

    How do I create a new entry with messageURL indented?
    Here's an approximate example of what I get with TaskPaper when I run your script as modified in my previous post:
    Cyberlettre du 19-01-2011 - Pétition - Tunisie
         message://%3C20110120170231.7BEB23D619@pmta4-1-fe10%3E
    Haïti : un an après le séisme
         message://%3C5464456.3052551294847006313.JavaMail.root@server8565%3E
    Surely I don't understand what you mean by “indented", since I would have considered lines 2 and 4 above as “indented”.

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • Robohelp X5 For HTML Support Question

    We are currently using Robohelp X5 for HTML and are
    contemplating an upgrade to version 7 probably later this year. In
    the meantime, has there been any discussion about ending support
    for X5?
    Please let us know - thanks.

    Hi Wayne
    There will be wars and there will be rumors of wars...
    X5 was introduced in January 2004. I'm not sure what you mean
    by "ending support". If that question is intended to ask if Adobe
    will "officially" stop supporting that version, I'm personally not
    sure they ever have!
    This isn't intended to slam Adobe Support in any way, but
    probably your best form of support is right here in these forums.
    As for upgrading to version 7, why upgrade to that when 8 is
    available and offers a richer experience?
    Cheers... Rick

  • Question about SAP Webgui for html

    I have 2 questions regarding captioned subject.
    1.  I am using Webgui for html under internet explorer 10 and find that there is a red box surrounding all texts.  Can I remove it ?  I have no such issue in IE 9.0 and chrome.
    2.   I found slow peformance of webgui for hmtl, espcially the ALV grid list is displayed.  It takes time to scroll from page to page.

    Hi,
    This is SAP Business one system administration forum. Please find correct forum and repost above query to get quick assistance.
    Close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

  • Can anyone answer a very simple question for me ive heard the apple was giving a free iphone 4 or 4s bumper away is there any truth to that?

    can anyone answer a very simple question for me ive heard the apple was giving away iphone 4 or 4s bumpers is there any truth to that?

    Not any more, no. There was a free bumper program back when the iPhone 4 originally came out. It has long since expired.

  • SOME SIMPLE QUESTIONS FOR ALL OF YOU

    hi,
    I have some questions for all of you.
    1. Oracle uses cgi (even asp!!! I've seen an asp page somewhere on an Oracle's site but this moment I don't remember where perhaps it is asp->cgi). Why ?
    Oracle doesn't support their techologies
    (Pl/SQL, Jsevlets,XML) ?
    2. Oracle says that has just released a
    new product for mobiles called "Portal2Go".
    I tried to install this product on NT with OAS 4.8.1.
    I had many problems during the installation and after many tries finally I did it(thanks God). but the problems continue...
    many Jsp errors (from the "tested" supplied apps). My question is:
    a. This product is in an early stage (many installation errors.. just a baby) and I think is stable for Sun Solaris but not on NT.
    b. You Oracle "experts" (i.e. oracle staff, NOT YOU guys) tell me ONE advantage to use you product (I'm an oracle developer for 6 years now):
    You say that I can PORT my existing app in any device and Web (through XML). This is a joke. Mobiles,PalmPCs,Web etc. have different requirements (content,display etc).The scope is different.. so this is absolutely FALSE (to use a boolean).
    This release is user unfrienlty. Why.. tell me WHY to pay for a product and for extra hardware (read the product technical reqs!!) to do the SAME THINK
    I do NOW with existing sources.
    I've developed an app for my company's employees using existing version of DB (8.0.5),pure pl/sql and a WAP GATEWAY.NOTHING LESS NOTHING MORE.
    please answer. Any comment welcomed...
    maybe I'm wrong maybe I'm not.
    PS.WHERE THE WAP GATEWAY/SERVER IS. I searced the cd and..nothing :-) ?
    thanks
    thanasis j.a.
    B.A. in Informatics
    M.Sc. in IS

    Portal-to-Go is a wireless portal server, the first version was released November 1999.
    The problems you describe that mobiles, Palm devices, etc all have different characteristics is one of the key reasons for Portal-to-Go. It allows any service to be displayed on any device by generating content in an appropriate format for specific devices. This way you can take into consideration the size of the screen, the display characteristics, etc.
    It is 'stable' on Solaris and NT, though it is true that the installation procedure of the CD is for Solaris only. The product is not currently available on OTN, so the installer restrictions should have been explained to you when you obtained the CD.
    Why Portal-to-Go? Here's three reasons:
    1. Inherent problems of the User Interface for a wireless device, so we provide a way personalise the UI to improve navigation and allow commonly used parameters to be saved as stored preferences through the portal.
    2. Differences in the characteristics between wireless devices make it hard to support all type without re-creating content and applications for each specific case. With Portal-to-Go, the same service can be accessed from any device.
    3. Lack of content available for WAP and other wireless devices. We have tools to quickly create wireless services from existing Web sites as well as an application platform for creating new Java or database applications for wireless devices.
    You are correct that the product does not have a WAP gateway.
    I'm not sure where you are located, but feel free to contact me offline. I can answer any specific questions, or get you contact with a local Oracle representative.
    At the moment, if anyone wants to obtain a copy of Portal-to-Go, you should contact your local Oracle representatives.
    Paul

  • Please answer a programming question for an admin

    I'm not a programmer (although my interest is growing), so I can't answer this question in a discussion regarding how Win32API w/OLE and COM is SO much better than programming for Unix/OS X applications.
    The original discussion was in regards to OS X's superior Unix based security, he devolved to this. Having only begun my venture into programming, his questions are a little above my head at this point. I'm also interested (as an amature programmer), how this would be accomplished in OS X/Unix.
    Thanks in advance.
    Here's his position:
    *(1st entry)*
    I have unsed Windows and many flavors of Unix and I have written programs in Assembler, Fortran, Pascal, Cobol, RPG, Smalltak, Basic, PowerBuilder, Delphi, C, C++, C#, Java, and Perl, and I have been programming for over 20 years, so I do have extensive knowledge about programming.
    So I have one question for you:
    If you had to build a business application that has to allow users to, spell and grammer check, and perform financial calculations, and render the HTML, how would you compare the effort to do this in Windows versus that in Linux, AIX, Solaris or any other Unix operating system?
    I can make this business application have these features in ONE DAY on Windows, because COM and OLE lets me, use Word to spell and grammer check, Excel to do the financial calculations, and IE to render the HTML!
    I make my living building complex customized business software, and Windows allow me to build these applications by myself in weeks, when it would take me and a team of programmers months to do these same things in Unix because of the lack of an the Win32 API, COM, and OLE, or I would have to BUY third party libraries that did these things, and deal with the licensing, versioning, and vendor problems that go with them, and none of those third party librabries would be close to Word, Excel, and IE in CAPABILITY!
    HONESTLY tell me and others reading this thread how you would go about create the customized business application I described above by yourself in a Unix instead of Windows, and tell us how many MONTHS or YEARS it would take you, or how you would have to BUY some other third party libraries to do what Word, Excel, and IE!
    Anyone who thinks a Unix has more CAPABILITIES than Windows, has never used Win32API/COM/OLE/.Net, and does not build customized complex business software for a living, because we people that do are the reason that you find some much customized business desktop software for Windows, and so little for any Unix.
    I have nothing against Unix, and it is great for simple business tasked server software, but for complex business tasked desktop software Windows with Win32API/COM/OLE/.Net wins hands down!
    *(2nd Entry)*
    A System administrators view of an operating system and an application developers view are entirely different, and the Win32API/COM/OLE/.NET simply make my job so much easier, and you simply don't understand because you do not have to deal with the "dirty' details of making what a user wants, which is why your definition of "integration" and mines are totally different!
    With the spell check you talked about, how will you keep in in synch with the dictionary in Word where the user is constantly adding and removing words?
    No, you would have the user to have to maintain two different spell check dictionaries, and you would totally ignore the grammer check requirement!
    Cutting and pasting data between applications is simple integration, and not the complex type that I am talking about.
    Can you make your application display and use the MacGourmet menus appear in its own window, and to access and use the MacGourmet functionality (ie. search for a recipe) in its own window?
    Give me one example of a Unix application that can display the menus of another application, yet alone control its features!
    Of course you can't, because you need COM and OLE!
    I am quite familiar with different flavors of Unix, but those operating systems do not have the rich API and program integration features namely COM and OLE that Windows has, because it violates the Unix idea of security by process isolation!
    Yes that idea of process isolation keeps the operating system safe from malicious code in applications and from one application taking the others down, but you lose the power of programs working together, and you simply cannot build the type of customized business applications that I build by myself, without reinventing the wheel over and over and without having a large team with lots of programmers.
    For example, my customers and millions of others spend all day working in Word and Excel, and the Windows idea that I can transparently integrate my complex business applications right in Word and Excel menu, and into their templates and macros, is why third party developers like me prefer Windows over Unix, regardless of how much better security in Unix is.
    Do not get me wrong, Java improves business application development on Unix, but unfortuantely it is not feasable to rewrite ever legacy application in Java, and Java does not integrate well with other programming languages.
    I used to code business application for both IBM MVS and Sun Solaris, and I never want to go back to those "bad" old days again, once I took the time to learn how to PROPERLY code using Win32API/COM/OLE/.NET!

    At risk of feeding the troll I'll wander in here:
    NOTE: Since this is an Apple programming boards and I have limited experience programming on traditional Unix systems (and most of that in college) I will confine my answers to the area I know.
    If you had to build a business application that has to allow users to, spell and grammer check, and perform financial calculations, and render the HTML, how would you compare the effort to do this in Windows versus that in Linux, AIX, Solaris or any other Unix operating system?
    I can make this business application have these features in ONE DAY on Windows, because COM and OLE lets me, use Word to spell and grammer check, Excel to do the financial calculations, and IE to render the HTML!
    Note that this scenario assumes the user has Microsoft office installed. The person argues that they don't have to purchase libraries to program but what they are effectively doing is simply transferring that cost to user. I don't have to purchase libraries but everyone of my users needs to. Good for you, very good for Microsoft but bad for your customer - IMHO. OK, I know "But all Windows business users have Office installed already." When it comes free with the system then I'll retract my objection.
    Under OS X and Cocoa many of these functions are intrinsic to the system layer and do not require any applications to be installed. Using Cocoa you can write a simple Word processor that has rulers, full font manipulation (including kerning, spacing and leading), Document Save and Load, Printing, Export to PDF as well as spell-checking in under 10 lines of actual code. Adding a custom file type and icon for full system integration will add another 5 minutes to your programing.
    In case you think I'm blowing smoke here is a tutorial from 2002 (yes, this has been possible for over 5 years) outlining the 8 line Word Processor build in Cocoa. http://www.stone.com/TheCocoa_Files/What_s_sofunny.html
    And yes, Cocoa also includes Webkit so I can add full HTML rendering by dragging in a WebKit window to my user interface. For an experienced Cocoa programmer this certainly sounds like less than a day of programming - in fact it sounds like a good tutorial for a middle-experienced training day or 2 day class in Cocoa.
    I won't include the link to the 1 line web browser you can build in Cocoa using Webkit because it's shorter than the description. Feel free to search for it if you want to.
    HONESTLY tell me and others reading this thread how you would go about create the customized business application I described above by yourself in a Unix instead of Windows, and tell us how many MONTHS or YEARS it would take you, or how you would have to BUY some other third party libraries to do what Word, Excel, and IE!
    BUT this is all done from the stock system that is on every OS X computer not simply those with Office installed. Obviously you'd need to add some features that were more complicated than this - because any halfway decent programmer could turn this stuff out - and polish takes a while but to meet the requirements of the challenge it would take 2 days tops.
    Is every *nix programming environment like this? I don't know I can only answer for the system that I have experience with and is the concern of this board. If you really have questions regarding *nix programming then I suggest you find an appropriate board and troll^H^H^H^H^H ask there.
    If you're ever serious about programming on the Mac feel free to stop by and actually take a look at it. I think you'll be surprised.
    =Tod

  • Question about HTML files using TextEdit

    First off, I wanted to ask if this is the proper place to post a question about HTML/XHTML. I couldn't really find anywhere else that seemed to fit better, but please point me in the right direction if this is not the place. Thanks.
    Moving on -- here's my question:
    I'm having trouble with working with HTML files in TextEdit. I'm on a Mac, using TextEdit as my HTML editor (I can not afford one of these other HTML editors, and I like using a simple text editor like TextEdit for HTML). Here's my problem: I open a new rich text document in TextEdit and write my HTML and then choose File>Save As and choose "HTML" under the File Format drop-down box. Having saved this file as an HTML file, I then open Safari and choose File>Open File and select my HTML file; however, when I do this, my web page's text does not appear in the browser window. Instead, the HTML code itself appears in the browser window, as if the browser was not interpreting it as HTML and converting it. The same problem happens when saving the file as a .htm file using Microsoft Word for Mac.
    So, as another solution (at the suggestion of a helpful poster in a previous thread), I tried creating a plain text file in TextEdit (instead of a rich text file like before). Now, in TextEdit there is no option for saving plain text files as HTML files, so I simply save it as a Unicode-8 format and then find the file in Finder and change the extension to .htm myself (I've tried .html as well). This, fortunately enough, actually works! When I open the file in Safari I get to see my web page as expected. However, the first time I quit out of the application TextEdit and then try to reopen my .htm file in TextEdit, I no longer can see my HTML code. Instead, TextEdit shows me the actual web page text that I would expect to see when I open the file in a browser, and my HMTL code is lost.
    Can someone please help me here? There has to be a way to edit HTML in TextEdit without the code disappearing every time you quit out of the application and reopen the HTML file. Any help is greatly, greatly appreciated. Thank you.

    That's the problem -- once I convert it to plain text there is no longer an HTML option under the Save As drop down menu. The drop down menu's title is Plain Text Encoding instead of File Format and the only options I get are Unicode-8, Unicode-16, Western, Chinese, and so forth. I can save it as an HTML file, but only if the file is rich text, which doesn't work for HTML.
    So, I can save it as plain text (.txt) and then go and change the extension myself, and like I said, it works if I do that. I can edit HTML in TextEdit and open the file properly in Safari to view my web page. The problem is (I went over all this in my first post) that, after that, if I exit TextEdit and reopen it, my document is no longer HTML code -- it is now simply the text of the web site as if I had opened it in a broswer.
    What do you suggest I do?

  • Why is 'f:' used for taglib of 'core' tags whereras 'h:' is for 'html'?

    Forgive a simple question from a new comer, but does anyone know why was 'f' chosen to signify the taglib for 'core' tags whereras 'h' is used for 'html'?
    E.g. f:attribute and h:form.
    Regards,
    SIDCUP

    Those are the preferred taglib prefixes, which weren't used by another taglibs yet. You can always change the taglib prefix to your taste in the taglib declaration. But for everyone's convenience it is smart to provide a preferred taglib prefix. I don't know the exact details and I don't really worry about it, but I guess that 'f' just stands for Faces and 'h' stands for HTML.

  • Can somebody give some real time questions for alv report

    hi guru
    can somebody give some real time questions for alv report.
    answers also.
    regards
    subhasis.

    hi,
    The ALV is a set of function modules and classes and their methods which are added to program code. Developers can use the functionality of the ALV in creating new reports,  saving time which might otherwise have been spent on report enhancement
    The common features of report are column    alignment, sorting, filtering, subtotals, totals etc. <b>To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).</b>
    Using ALV, we can have three types of reports:
       1. Simple Report
       2. Block Report
       3. Hierarchical Sequential Report
    <b>Reward useful points</b>
    Siva

Maybe you are looking for

  • How can i convert an ascii character to a number?

    where can I find the function?

  • Smart Objects in CS5 behave differently than in CS4?

    I've just upgraded from CS4 to CS5, and I've noticed, what is to me, a BIG change in the way Smart Objects work. Imagine this simplified hypothetical scenario... I create a document in Illustrator, with two layers. On one layer would be a 800x600 sol

  • Keep getting fatal error message when i try to load itunes

    everytime i try and load the itunes program onto my computer i keep getting the message: could not gain access to HKEYLOCALMACHINE\Software\Classes\.cdda\OpenWithProgides key, please make sure you have access to this key and then try again.. now try

  • N8-00 (Belle Refresh) vs. Fiat Blue&Me pairing pro...

    Hello there, Fiat, Alfa Romeo and Lancia cars has Microsoft Mobile based Bluetooth audio setup. http://www.blueandme.net/blueandme/index.aspx Once you pair your BT connection with Blue&Me, you can call and accept calls via the car. But, my N8-00 (Bel

  • Can't replace procedure

    Hi: I am using Squirrel as the client tool using JDBC RAC driver against Oracle 11.1. I am trying to replace an existing Oracle procedure with: CREATE OR REPLACE PROCEDURE MY_PROC AS BEGIN DELETE FROM table1 WHERE IEX_DATE >= (select max(idate) from