I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Four coordinate are required For drawing the line in the java applet. First two coordinate define the origin point of the line. Origin point start from upper left corner and further x-coordinate increase in right side and y-coordinate increase downward.
Syntax of drawLine in Java Applet
Graphics_Instance . drawLine(int X1, Int Y1, int X2, int Y2);
If you want to set color on line then use setColor( ) method of Graphics class, which is exist in java.awt package.
Example - designline.java
import java.awt.*;
import java.applet.*;
public class designline extends Applet
{
int width,height;
public void init()
{
setBackground(Color.black);
}
public void paint(Graphics g)
{
g.setColor(Color.green);
g.drawLine(0,0,200,200);
}
}
Compilation of Applet code and generate the class file
Prepare the HTML file in the same location with <applet> tag. Like
<applet code="designline" width="400" height="400" />
Save the .html file in same location also run in any browser.
Code Generate the following output
Syntax of drawLine in Java Applet
Graphics_Instance . drawLine(int X1, Int Y1, int X2, int Y2);
If you want to set color on line then use setColor( ) method of Graphics class, which is exist in java.awt package.
Example - designline.java
import java.awt.*;
import java.applet.*;
public class designline extends Applet
{
int width,height;
public void init()
{
setBackground(Color.black);
}
public void paint(Graphics g)
{
g.setColor(Color.green);
g.drawLine(0,0,200,200);
}
}
Compilation of Applet code and generate the class file
<applet code="designline" width="400" height="400" />
Save the .html file in same location also run in any browser.
Code Generate the following output
Using the init ( ) method, you can set the back ground color of the applet. Also set the line color using the graphics class.
Comments
Post a Comment