From: George D. <li...@iD...> - 2014-01-20 21:02:39
|
Jim, On 1/20/14, 3:51 PM, Jim Xie wrote: > > George, > > Here is what I want to do: > 1. display url in JWebBrowser (JWebBrowser.navigate(url)) > 2. final HtmlPage page = WebClient.getPage(url); > 3. parse HtmlPage to get a list of HtmlElement. > 4. change some style on HtmlElemnt using first email of code. > 5. New change of style should be seen in JWebBrowser. > > At this point, I cannot see new change in JWebBrowser. How would JWebBrowser see changes made in memory by HtmlUnit? They are two separate browsers. -- George > > Jim > > ----- Original Message ----- > From: "George Dinwiddie" <li...@iD...> > To: htm...@li... > Sent: Monday, January 20, 2014 3:13:40 PM > Subject: Re: [Htmlunit-user] How to change a form background color > > Jim, > > On 1/20/14, 2:44 PM, Jim Xie wrote: >> I have the following code that changes a form style >> >> HtmlForm htmlForm = getForm(); //supposed to get a HtmlForm object. >> ScriptableObject scriptObject = htmlForm.getScriptObject(); >> HTMLFormElement formElement = (HTMLFormElement)scriptObject; >> ComputedCSSStyleDeclaration style = formElement.getCurrentStyle(); >> style.setBackgroundColor("#FF0000"); >> style.setBorderColor("blue"); >> >> The above code doesn't work. Please help me out. > > What were you expecting it to do? > > - George > -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- |